Pass Tables to Stored Procedure / Table Valued Parameter
page 1 of 3
Published: 06 Nov 2009
Unedited - Community Contributed
Abstract
When we have to pass multiple rows of data to SQL Server, the developers either have to send one row at a time or come up with other workarounds to meet requirements like using XML to pass data, which is complex and tedious to use. There is a SQLBulkCopy object available in .NET to send multiple rows of data to SQL Server at once, but this still cannot be passed to a stored procedure. SQL Server 2008 provides a new feature called "Table-Valued Parameters". This provides us the ability to easily pass a table to a stored procedure from T-SQL code or from an application as a parameter.
by Aamod Thakur
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 119316/ 895

Introduction

When we have to pass multiple rows of data to SQL Server the developers either have to send one row at a time or come up with other workarounds to meet requirements like using XML datatype to pass data which is a bit complex and tedious to use. Also there is a SQLBulkCopy object available in .Net to send multiple rows of data to SQL Server at once, but the data still can not be passed to a stored procedure.


View Entire Article

User Comments

Title: nfl jerseys cheap   
Name: NIKE NFL jerseys
Date: 2012-07-02 10:09:54 AM
Comment:
http://www.jersey2shop.com
http://www.cheapjersey2store.com
http://www.jerseycaptain.com
http://www.yourjerseyhome.com
We are professional jerseys manufacturer from china,wholesal.cheap nike nfl jerseys, mlb jerseys, nhl jerseys,nba jerseys and shoes
Cheap NFL,NBA,MLB,NHL
,heap jerseys,2012 nike nfl Jerseys,nba jersey and shorts,oklahoma city thunder jersey,official jeremy lin new york knicks jersey,NFL Jerseys Wholesale,blake griffin jersey blue,NFL jerseys For Sale online.All Our Jerseys Are Sewn On and Directly From Chinese Jerseys Factory
,Wholesale cheap jerseys,Cheap mlb jerseys,]Nike NFL Jerseys,Cheap China Wholesae,Wholesale jerseys From China,2012 nike nfl Jerseys,Jerseys From China,,2012 nike nfl Jerseys,Revolution 30 nba jerseys,jersey of nba chicago bulls direk rose ,nfl jerseys,green bay packers jerseys wholesale,Buffalo Bills nike nfl jerseys sale,good supplier soccer jerseys,cool base mlb jerseys,Revolution 30 nba jerseys,2012 stanley cup nhl jersey,
We are professional jerseys manufacturer from china,wholesal.cheap nike nfl jerseys, mlb jerseys, nhl jerseys,nba jerseys and shoes. www.yourjerseyhome.com
Title: ERROR   
Name: ERRUT
Date: 2012-03-17 2:06:27 AM
Comment:
I AM GETTING MANY ERRORS WHILE USING THIS CODE
Title: Loosing time   
Name: Radu
Date: 2011-11-07 9:40:59 AM
Comment:
This article was a totaly waste of my time.
Title: Disappointed   
Name: Ajai
Date: 2010-07-12 12:22:46 AM
Comment:
You never mentioned how to execute this stored proc from c# or Sql window itself.
Title: Pass TVP in another sproc   
Name: ak
Date: 2010-04-26 2:40:45 PM
Comment:
How would i pass TVP to sproc#2 from inside sproc #1
exec @MyParameter MessageQueue READONLY
is this correct?
Title: Disaapointed   
Name: Ajay
Date: 2010-04-13 11:05:33 AM
Comment:
Good article but not what i am looking for
Title: Good article   
Name: Chitta Ranjan Nayak
Date: 2010-02-26 9:40:36 AM
Comment:
Really a good article.
Title: good article   
Name: manas sahu
Date: 2009-12-23 8:46:08 AM
Comment:
Good article but not what i m looking for.
Title: Title misleading   
Name: Chin Kiat
Date: 2009-12-08 1:26:10 AM
Comment:
The title is not match to what you are posting...i understand why jeewan disaapointed =(
Title: disappointed   
Name: jeewan
Date: 2009-11-20 5:48:05 AM
Comment:
Not what i am searching
http://pictube1.blogspot.com/






Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2017 ASPAlliance.com  |  Page Processed at 2017-11-22 10:32:41 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search