May 2016

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 »