Category Archives: SQL Server

How to combine multiple stored procedures into a single resulset

Let’s say, you have multiple stored procedures each of which is tied to a partial view or View Component in MVC. Now, while this may seem like a logical thing to do, but what if you want the entire payload … Continue reading

Posted in SQL Server | Comments Off on How to combine multiple stored procedures into a single resulset

How to pass delimited list to a Stored Procedure

Let’s write a Table-valued function below. This can be created by navigating to Functions – Table-Valued Functions inside SQL Management Studio. Just an FYI, I am using the AdventureWorks database, but this  sample can be used in any situation. CREATE … Continue reading

Posted in SQL Server | Comments Off on How to pass delimited list to a Stored Procedure

Difference between Varchar and Nvarchar. When to use what?

To order essay on an author of the essay not only that but safely. Our exchange provides a number of obligations, which guarantee customers that they will receive a high quality and decent work: each essay is checked by the … Continue reading

Posted in SQL Server | Comments Off on Difference between Varchar and Nvarchar. When to use what?

What are Nested Transactions in SQL Server?

As the name suggests, nested transaction is one that is nested within a transaction. Let’s illustrate this with an example. Let’s create a table: CREATE TABLE PERSON ( ID INT IDENTITY(1,1), FirstName VARCHAR(25), LastName VARCHAR(25), Gender CHAR(1) ) SELECT * … Continue reading

Posted in SQL Server | Comments Off on What are Nested Transactions in SQL Server?

How to partition the result set in SQL Server

To query the first row or the last row in a table is easy-piecey.  You simply select the Top 1 row and order the query by ascending or descending. But, how about selecting the second, third or tenth row from … Continue reading

Posted in SQL Server | Comments Off on How to partition the result set in SQL Server