Currently executing SQL statements

Microsoft SQL Server introduced various dynamic management views and dynamic management functions to view the server and database state and it is very helpful for troubleshooting, performance tuning, monitoring and…

Read more »

How to find the physical location of locked records in SQL Server

SQL Server by default locks the table or page or rows when it executes the transact statement. There are different types of locks such as exclusive, shared, schema modification lock…

Read more »

DATALENGTH vs LEN function in SQL

DATALENGTH function returns the size used by a column or an expression whereas the LEN function returns the number of characters. Let’s explore with few examples The DATALENGTH function returns…

Read more »

Uses of OUTPUT clause in SQL Server

The output clause introduced in SQL Server 2005 is handy and it simplifies the coding for different scenarios. It returns inserted, deleted and updated records to the client application. Employee…

Read more »

Using constraint improves query performance

We know that the constraints are used to enforce the data integrity. A CHECK constraint is used to limit the value being entered into a column, similarly, unique constraint is…

Read more »

Table Value Constructor in SQL Server

The values clause is not new to SQL Server, it is used to hard-code values while inserting records into table. The value constructor is enhanced in SQL 2008 which provides…

Read more »

Compile time of SQL statement

Query recompile and stored procedure recompile is not a good sign for performance for certain situations. The SQL statement by default cached for reuse, if the same query is requested…

Read more »

Table Partition in SQL Server – (Basics of table partition and implementation)

Partition is a feature introduced in SQL Server 2005. Partition is a method to slice the data to many smaller chunks from larger table. There are many benefits by partitioning…

Read more »

Table type in sql

Table type is introduced in SQL 2008. Table type will be useful to send multiple records to a store procedure or function and it can be used to declare a…

Read more »

NULL value for empty field when importing flat file in SSIS

When importing data from text file you may need to apply NULL to the field where no values present (blank). Not doing so the package may fail. Consider a scenario;…

Read more »