0% found this document useful (0 votes)
16 views4 pages

99 Table Valued Parameters in SQL Server

This document is a video tutorial on using Table Valued Parameters in SQL Server, a feature introduced in SQL Server 2008 that allows passing multiple rows of data to stored procedures. It provides a step-by-step guide on creating a user-defined table type, using it in a stored procedure, and inserting data into an Employees table. The tutorial is aimed at beginners and intermediate programmers interested in SQL Server, .NET, and C#.

Uploaded by

realayoola007
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views4 pages

99 Table Valued Parameters in SQL Server

This document is a video tutorial on using Table Valued Parameters in SQL Server, a feature introduced in SQL Server 2008 that allows passing multiple rows of data to stored procedures. It provides a step-by-step guide on creating a user-defined table type, using it in a stored procedure, and inserting data into an Employees table. The tutorial is aimed at beginners and intermediate programmers interested in SQL Server, .NET, and C#.

Uploaded by

realayoola007
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

3/12/2023 Sql server, .

net and c# video tutorial: Table valued parameters in SQL Server


The Wayback Machine - https://web.archive.org/web/20210805084156/https://csharp-video-tutorials.blogspot.com/2015/09/table-valued-para…
More Create Blog Sign In

Sql server, .net and c# video tutorial


Free C#, .Net and Sql server video tutorial for beginners and intermediate programmers.

Support us .Net Basics C# SQL ASP.NET Aarvi MVC Slides C# Programs Subscribe Download

Table valued parameters in SQL Server

Suggested Videos
Part 96 - Logon triggers in sql server
Part 97 - Select into in sql server
Part 98 - Difference between where and having in sql server

Pragim Technologies - Best software


training and placements in marathahalli,
bangalore. For further details please call
09945699393.

Complete Tutorials
How to become a full stack web
developer

Cloud computing complete tutorial

In this video we will discuss table valued parameters in SQL Server. Healthy food for healthy mind and
body

JavaScript tutorial

Bootstrap tutorial

Angular tutorial for beginners

Angular 5 Tutorial for beginners

https://web.archive.org/web/20210805084156/https://csharp-video-tutorials.blogspot.com/2015/09/table-valued-parameters-in-sql-server.html 1/4
3/12/2023 Sql server, .net and c# video tutorial: Table valued parameters in SQL Server

Important Videos
The Gift of Education

Web application for your business

How to become .NET developer

Resources available to help you

Dot Net Video Tutorials


Blazor tutorial

C tutorial

ASP.NET Core Tutorial


Table Valued Parameter is a new feature introduced in SQL SERVER 2008. Table
Valued Parameter allows a table (i.e multiple rows of data) to be passed as a parameter ASP.NET Core Razor Pages Tutorial
to a stored procedure from T-SQL code or from an application. Prior to SQL SERVER
2008, it is not possible to pass a table variable as a parameter to a stored procedure. Angular 6 Tutorial

Let us understand how to pass multiple rows to a stored procedure using Table Valued Angular CRUD Tutorial
Parameter with an example. We want to insert multiple rows into the following
Angular CLI Tutorial
Employees table. At the moment this table does not have any rows.
Angular 2 Tutorial

Design Patterns

SQL Script to create the Employees table SOLID Principles


Create Table Employees
( ASP.NET Web API
Id int primary key,
Bootstrap
Name nvarchar(50),
Gender nvarchar(10) AngularJS Tutorial
)
Go jQuery Tutorial

Step 1 : Create User-defined Table Type JavaScript with ASP.NET Tutorial

CREATE TYPE EmpTableType AS TABLE JavaScript Tutorial


(
Charts Tutorial
Id INT PRIMARY KEY,
Name NVARCHAR(50), LINQ
Gender NVARCHAR(10)
) LINQ to SQL
Go
LINQ to XML
Step 2 : Use the User-defined Table Type as a parameter in the stored procedure.
Table valued parameters must be passed as read-only to stored procedures, functions Entity Framework
etc. This means you cannot perform DML operations like INSERT, UPDATE or DELETE
WCF
on a table-valued parameter in the body of a function, stored procedure etc.
ASP.NET Web Services
CREATE PROCEDURE spInsertEmployees
@EmpTableType EmpTableType READONLY Dot Net Basics
AS
BEGIN C#
INSERT INTO Employees
SELECT * FROM @EmpTableType SQL Server
END
ADO.NET

Step 3 : Declare a table variable, insert the data and then pass the table variable as a ASP.NET
parameter to the stored procedure.
GridView
DECLARE @EmployeeTableType EmpTableType
ASP.NET MVC
INSERT INTO @EmployeeTableType VALUES (1, 'Mark', 'Male')
INSERT INTO @EmployeeTableType VALUES (2, 'Mary', 'Female') Visual Studio Tips and Tricks
INSERT INTO @EmployeeTableType VALUES (3, 'John', 'Male')
Dot Net Interview Questions
INSERT INTO @EmployeeTableType VALUES (4, 'Sara', 'Female')
INSERT INTO @EmployeeTableType VALUES (5, 'Rob', 'Male')
Slides
https://web.archive.org/web/20210805084156/https://csharp-video-tutorials.blogspot.com/2015/09/table-valued-parameters-in-sql-server.html 2/4
3/12/2023 Sql server, .net and c# video tutorial: Table valued parameters in SQL Server

Entity Framework
EXECUTE spInsertEmployees @EmployeeTableType
WCF
That's it. Now select the data from Employees table and notice that all the rows of the
table variable are inserted into the Employees table. ASP.NET Web Services

Dot Net Basics

C#

SQL Server

ADO.NET

ASP.NET

GridView
In our next video, we will discuss how to pass table as a parameter to the stored
procedure from an ADO.NET application ASP.NET MVC

Visual Studio Tips and Tricks

Java Video Tutorials


Part 1 : Video | Text | Slides

Part 2 : Video | Text | Slides

Part 3 : Video | Text | Slides

Interview Questions
C#

SQL Server

Written Test

2 comments:

Unknown September 18, 2015 at 1:07 AM


Thanks Venkat Please could you Upload a video on Paging in SQl Server with
implementation in asp.net.
Reply

Replies

Unknown September 21, 2015 at 8:46 AM


Paging is explained in gridview section part 55.

http://csharp-video-tutorials.blogspot.in/2013/10/part-55-custom-sorting-and-
paging-in.html

Reply

Enter your comment...

Comment as: Google Accoun

Publish Preview

It would be great if you can help share these free resources

Newer Post Home Older Post

https://web.archive.org/web/20210805084156/https://csharp-video-tutorials.blogspot.com/2015/09/table-valued-parameters-in-sql-server.html 3/4
3/12/2023 Sql server, .net and c# video tutorial: Table valued parameters in SQL Server
Subscribe to: Post Comments (Atom)

Powered by Blogger.

https://web.archive.org/web/20210805084156/https://csharp-video-tutorials.blogspot.com/2015/09/table-valued-parameters-in-sql-server.html 4/4

You might also like