How to rename column name of a table in SQL Server

The system stored procedure “sp_rename” is used for renaming user-created objects in the database. The following code is renaming the column “empdoj” to “empjoindate” in “emp” table. The first parameter…

Read more »

Why weekday and week is non-deterministic in SQL Server

The DATEPART function returns an integer value for the given date part. The date part could be the year,  quarter, month, week, day etc., A deterministic function should return the…

Read more »

UNIQUIFIER – The hidden column in the SQL Server table

A four-byte internal column is automatically created by SQL Server when clustered index created on a non-unique column. This column is referred to as UNIQUIFIER. A clustered index can be…

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 »

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 »

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 »

How to get error description in SSIS dataflow

In SSIS, there is no direct method to get the error description when error occurred during data Load and transformation. We can only redirect the failed records along with Error…

Read more »