2016

Unfolding | Set Based Approach | How join works internally – Episode 4

In this video, we are going to understand how join works internally. If you have a good understanding of joins and how it works, you can skip this video and move to the next video in this series. If not, lets start understanding the joins. You can download the script used in this example from below the video. Here […]

Unfolding | Set Based Approach | How join works internally – Episode 4 Read More »

Unfolding | Set Based Approach | SQL Server Query execution architecture – Episode 3

In this video, we are going to understand the query execution architecture which helps us to understand the importance of set based approach. When a T-SQL statement gets submitted to SQL server, it goes through multiple steps before we get the final output. Lets have a look on SQL Server query execution architecture.

Unfolding | Set Based Approach | SQL Server Query execution architecture – Episode 3 Read More »

Unfolding | Set Based Approach | Introduction to the course – Episode 2

This video will give you insight of the topic that we are going to cover in this series. We know that the thinking in terms of sets is creative and innovative and once you start understanding the concepts, believe me, you will find it is simple too. Writing set based queries needs a good understanding

Unfolding | Set Based Approach | Introduction to the course – Episode 2 Read More »

Unfolding | Set Based Approach | Why set based approach – Episode 1

Welcome to my course “Unfolding | Set Based Approach”. This is my first video tutorial series. In this series, I am going to share the concepts and techniques being used to create set based SQL queries. This course is not based on how to write queries (this you can find at many places), rather it is based on

Unfolding | Set Based Approach | Why set based approach – Episode 1 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 »

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 »

Change stored procedure output column names and data types

Can we change the output column name and their data type being received from a stored procedure during execution? Yes, SQL Server 2012 introduced “WITH RESULT SETS” option which can be used with EXECUTE command to redefine the metadata of result sets being received from stored procedures. This option can handle single as well as multiple result sets.

Change stored procedure output column names and data types Read More »

The join order has been enforced because a local join hint is used – Warning in SQL Server

When we use a local JOIN hint in T-SQL query, sometimes, SQL Server throws a warning message as “Warning: The join order has been enforced because a local join hint is used.“. For example, below is a query with a local join hint: After execution, we will get below warning message with result set: In above code, we are using

The join order has been enforced because a local join hint is used – Warning in SQL Server Read More »

Dynamic PIVOT query in SQL Server

PIVOT clause is used to generate cross tab outputs in SQL Server. We put unique data values from a column in the PIVOT clause to render them as multiple columns in aggregation with other columns required in the output. With the help of PIVOT clause, we can transpose the distinct values of a column into multiple columns. However, syntax of PIVOT clause requires these distinct values to

Dynamic PIVOT query in SQL Server Read More »