Log in | Register

Programming Archives - SQL Server Blogs, Events, Webcasts, Videos, SQL Server learning & education Programming Archives - SQL Server Blogs, Events, Webcasts, Videos, SQL Server learning & education



STRING_SPLIT in SQL Server 2016

Hello Friends,

In continuation to my previous post, I’m going have chosen another function from SQL Server 2016 to put forward here.

New STRING_SPLIT() function in SQL Server 2016 to split a string into multiple values & rows. Function returns table from a string parameter

Type of Parameter : VARCHAR, NVARCHAR, CHAR and NCHAR

Count of parameters: 2 (Two) – […]

Nested Loop Join Internals

Hi Friends,

Today, I am going to show you Nested Loop Join Internals in terms of performance.

Generally, we write a query in SSMS and then submit it to SQL Server for execution. In the query, there may be join conditions like an inner join, outer join, self join, etc. all these are the logical joins […]

T-SQL to create the File Group and Files

Hi Friends,

Below is the simple T-SQL to create File Group and Files for a database and adding multiple files under that file group. Here you can specify values as per your requirement like:

1- Database Name under which you wants to add file group.
2- Name of the file group.
3- Number of files, you wants to […]

sp_addextendedproperty – Day 2 – SQL Server System Stored Procedure

Hi friends, today in SQL server system stored procedure series we will look into stored procedure sp_addextendedproperty.

Sp_addextendedproperty stored procedure is used to create metadata about our database objects. Using this stored procedure we can put information about Sql server objects like name of developer who created the object, to track the version of objects […]

SQL Server Get free space in all files in an Instance

SQL Server Get free space in all files in an Instance:

As DBAs we are always challenged of unexpected size growth of log or data files and need to shrink files based on available free space in each file. Most of the times we are stuck and do a lot of scripting to find the […]

SQL Server Security Audit – A (time consuming) task for DBA simplified

Many DBAs need to perform SQL Server security audit and save the permissions for each account at server level and database level. This will be done time to time and verified so that no elevated permissions are provided to any user than required. But to collect data of database roles and server roles of […]

SQL Server Free Disk Space Monitor Alerts – SQL Script


I had a SQL Server fee disk space monitor job in my environment which throws an alert when the free space on any drive drops below a threshold free space. But it did not have the information to help us directly attack the server and the right drive and which folder and file exactly […]

Auto parameterization in SQL Server

Dear Friends,

Today we are going understand auto parameterization in SQL Server. In simple words SQL Server query optimizer may return the same plan in the cases where it doesn’t matter which parameter value is supplied in a query. So query optimizer may decide to parameterize queries in cases where the specific parameter does not […]

SQL Server optimize for unknown and local variables

Hi Geeks,

In my previous blog post we saw how parameter sniffing could negatively impact any query performance when SQL Server query optimizer decides to sniff parameters. There are different ways that helps us to avoid this problem and today I’m going to discuss SQL Server optimize for unknown and local variables.

Local variables

Let me modify our stored […]

Parameter sniffing in SQL Server

Hi Friends,

SQL Server uses histograms from statistics objects to estimate cardinality of a query and this helps SQL Server to produce an optimal execution plan. Query optimizer has to inspect values supplied in query parameters and this behaviour is called Parameter sniffing in SQL Server.

Plan cache can store execution plans so that they can […]