SQL Server

Why Python and how to use it in SQL Server 2017

Microsoft has integrated Python in SQL Server 2017 which can be used for in-database analysis purpose. In this post, we are going to explore “Why Python and how to use it in SQL Server 2017”, and then we will explore that how we can use it in SQL Server 2017. Why Python Python is a […]

Why Python and how to use it in SQL Server 2017 Read More »

Specific row at the top then sort the rest result set in SQL Server

In this post, “Specific row at the top then sort the rest result set in SQL Server“, we are going to learn that how we can order a result set in a customized way which cannot be achieved using ORDER by Clause in a simple way. To demonstrate this, let’s create a sample table named as “tbl_Department” and insert

Specific row at the top then sort the rest result set in SQL Server Read More »

Use NEWID() inside function in SQL Server

In SQL Server, if we use the NEWID() function inside an user-defined function, it throws an error as “Invalid use of side-effecting or time-dependent operator in ‘newid()’ within a function.” For any reason, if we need to use the NEWID() function inside an user-defined function, we need to do some work around. In this post,

Use NEWID() inside function in SQL Server Read More »

Extract the first number from an alphanumeric string in sql server

In this post, we are going to learn how to extract the first numeric value from an alphanumeric string in SQL Server. To demonstrate this, we will create a dummy table and then we will insert some dummy rows into that table. Finally, we will use a SELECT statement to extract the first numeric value

Extract the first number from an alphanumeric string in sql server Read More »

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 »

Select all elements regardless of level in XML

We have already published a post on “Read XML Data as a table in SQL Server” and “Read and compare XML nodes dynamically with unknown elements“. In this post, we will see that how we can skip levels in XML string to read all the elements at a given level regardless of the level name. A wildcard character * (asterisk) can be used

Select all elements regardless of level in XML Read More »

It’s time to install SQL Server 2016

Microsoft has launched the SQL Server 2016. We can download and install it from here. However, when we start installation of SQL Server 2016, we can see some installation changes there. Prior to SQL Server 2016, “SQL Server Management Studio (SSMS)” was a part of the feature list of main SQL Server installation (which starts after clicking

It’s time to install SQL Server 2016 Read More »