The ‘SQL Server’ Archives
Posted October 27, 2019 by

How To Index Computed Column In SQL Server

How To Index Computed Column In SQL Server

The computed column also referred to as calculated or generated column. Derived from other column value or an expression. This tech-recipe post inlined with published post How To Use Computed Column In SQL Server. Refer the earlier post as a beginners’ guide to a computed column in SQL Server.

Category Database, SQL Server

Posted October 19, 2019 by

How To Use Computed Column In SQL Server

Computed Columns In SQL Server_7

Computed columns or Calculated columns in SQL Server as the name suggest, computed based on other column values instead of manual user input. Regular columns are populated by user or external inputs. However, computed columns are derived using existing columns which receive input from a user.

Category Database, SQL Server

Posted October 16, 2019 by

Introduction To DATETIME Functions In SQL Server

DateTime Functions In SQL Server_FII

Need for DateTime functions in SQL Server to keep track of date and time has always been a vital part of database design. Most database designs need to track date and time by storing and retrieving it for reporting purposes. Be it an e-commerce website where transaction, sales and purchases need a DateTime. Insurance companies, […]

Category Database, SQL Server

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