sql tips

STRING_SPLIT function – SQL Server 2016

Finally, STRING_SPLIT function, one of the most awaiting feature for a long time, has been introduced by Microsoft. In SQL Server 2016, now, we have a built-in system function to split a string with a specified separator. Earlier, whenever we had to map a denormalized string (e.g. comma separated string values) with the values stored in a table column (normalized […]

STRING_SPLIT function – SQL Server 2016 Read More »

DATEDIFF and DATEDIFF_BIG – SQL Server 2016

We are already familiar with DATEDIFF function introduced in the very initial version of SQL Server. But, in SQL Server 2016, Microsoft has introduced DATEDIFF_BIG function which can be used to compute the difference between two given dates in terms of the given date part. In this post, we are going to explore the use of

DATEDIFF and DATEDIFF_BIG – SQL Server 2016 Read More »

Set vs Select – Assigning variables

SET and SELECT both can be used to assign values to the local variables in SQL Server. However, SET is an ANSI standard and also recommended by Microsoft to be used for variable assignment. In this post, “Set vs Select – Assigning variables“, we will explore the behavior of SET and SELECT statement during variable assignment from a query. When we

Set vs Select – Assigning variables Read More »