The ‘SQL Server’ Archives
Posted September 21, 2019 by

How To Create SQL Server Database Project In Visual Studio

SQL Server Database Project In Visual Studio_7

SQL Server database project imports multiple database objects from a single/ multiple databases under one visual studio solution. Generally, converting all database objects into .sql files and bringing them under a solution & version control. Database objects include tables, schemas, stored procedures, views, etc.

Category Database, SQL Server

Posted September 13, 2019 by

Multiple CTEs Query Definition In SQL Server

Multiple CTEs Query Definition In SQL Server

CTE shorthand for Common Table Expression used to simplify derived, nested and complex queries. In contrast, using CTE for writing & breaking complex logic, which is reusable and easily readable. CTE scope to single INSERT/ UPDATE/ DELETE statements, moreover, until the query lasts. Namely, CTE is similar to a view or derived table. CTE is […]

Category Database, SQL Server

Posted September 8, 2019 by

CTE With (INSERT/ DELETE/ UPDATE) Statement In SQL Server

CTE With (INSERT/ DELETE/ UPDATE) Statement In SQL Server

CTE shorthand for Common Table Expression used to simplify derived, nested and complex queries. In contrast, using CTE for writing & breaking complex logic, which is reusable and easily readable. CTE scope to single INSERT/ UPDATE/ DELETE statements, moreover, until the query lasts. Namely, CTE is similar to a view or derived table. CTE is […]

Posted August 24, 2019 by

How To Use Table Value Constructor In SQL Server

Table Value Constructor (TVC) allows to group multiple rows of data in a single DML statement. Before SQL Server 2008, inserting multiple rows to a table required multiple INSERT INTO VALUES clause. However, table value constructor (TVC) does this in one go. TVC works as a VALUES clause in INSERT/ SELECT as well as in […]

Category Database, SQL Server

Posted August 18, 2019 by

How To Enable Dark Theme In SQL Server

How To Enable Dark Theme In SQL Server

Many developers prefer a dark theme in their programming environment. It looks cool and softens to eyes. In my personal opinion, a dark theme helps me to focus and soothes my eyes from white brightness. Additionally, some studies suggest a dark environment saves more power. SQL Server developers, a delightful thing to know that we […]

Category Database, SQL Server

Posted August 15, 2019 by

How To Use SET IDENTITY_INSERT In SQL Server

How To Use SET IDENTITY_INSERT Statement In SQL Server

SQL Server includes IDENTITY property to generate auto-increment numbers. IDENTITY generates incrementing numbers when a record is inserted into a table. Often referred to as a surrogate key, and commonly used as a primary key to have unique incrementing values in a column. While inserting a record in a table, we do not have to […]

Category Database, SQL Server

Posted June 23, 2019 by

How To Use CHECKSUM_AGG Function In SQL Server

How To Use CHECKSUM_AGG Function In SQL Server

Checksum returns a value to verify the integrity of input. Generally indicating whether the input value has changed over time. So that this can help us to find if a value has been changed since the last operation. Moreover, SQL Server includes different CHECKSUM functions to verify the change in a single value or group […]

Category Database, SQL Server

Posted June 14, 2019 by

How To Use Searched CASE Expression In SQL Server

How To Use Searched CASE Expression In SQL Server_3

CASE statement, an expression to evaluate different conditions to return a scalar value, when a condition is met. If none of the condition evaluated to TRUE then expression from ELSE block will be returned. Although ELSE block is optional. Above all, the CASE statement have two formats Simple CASE & Searched CASE.

Category Database, SQL Server

Posted June 2, 2019 by

WAITFOR Statement To Delay Query Execution In SQL Server

WAITFOR Statement To Delay Query Execution In SQL Server

Sometimes, we need to pause the execution of a query to simulate different scenarios. Waiting for a desired amount of time or executing it at a specified clock time. Helpful to pause a query, batch or a stored procedure. WAITFOR statement can be used for delaying a query or execute a query at a specified […]

Category Database, SQL Server

Posted May 28, 2019 by

EXCEPT and INTERSECT – SET Operator In SQL Server

SQL Server supports ANSI SET operators. Including UNION, UNION ALL, EXCEPT and INTERSECT. Generally, SET operators used to combine multiple query result sets into a single result set. In an early post on tech-recipes, we have learned the use of UNION and UNION ALL operators.

Category Database, SQL Server

Posted May 23, 2019 by

How To Send Email Using Database Mail In SQL Server

How To Send Email Using Database Mail In SQL Server

Sending email is a routine task needed in any application. Emails used for sending an alert, message, query result, attachment or any other notification to users. SQL Server uses the Database Mail component to configure and send emails. Using this back end component rather than a frontend application for sending email is hassle-free. Giving more […]

Category Database, SQL Server

Posted May 21, 2019 by

How To Schedule SQL Agent Job Using SSMS GUI

SQL Server agent job is a windows service based scheduler. Agent job is used to schedule and automate SQL scripts, administrative tasks, SSIS packages and various other tasks using SQL agent job tool. This component is integrated along with SSMS and available under Object explorer as SQL Server Agent.

Category Database, SQL Server