The Active Network
ActiveMac Anonymous | Create a User | Reviews | News | Forums | Advertise  
 

  *  

  Introducing Table-Valued Parameters - Part 1
Time: 22:06 EST/03:06 GMT | News Source: Microsoft | Posted By: Jonathan Tigner

I am Himanshu. I am a program manager in the ADO.Net team. Today I am going to talk about Table-Valued parameters that are new in SQL Server 2008. About 4 years back I was writing an application which involved adding metadata about my music library into a database. The database had a table each for storing Artists, Albums, and Songs. While adding an Album of songs into the database I had to insert data into each of these tables. I had defined stored procedure for inserting data into each of the tables. In the first iteration there was a bug in the code due to which these operations were not being done in a single transaction. Needless to say this bug surfaced as a data-corruption issue later on. Once identified the fix was trivial, ensure that all commands are executed in a single transaction. However, what I would have really liked to do was to be able to call a single stored procedure to which I could pass the metadata about the Album and the list of songs at the same time. But there was no good way of accomplishing this back then. I was programming against SQL Server 2000 back then. I am excited to say that now with the new table-valued parameters in SQL Server 2008 I can finally write a single stored procedure that will let me accomplish this without any kind of hacks!

Table-Valued parameters, as the name suggests lets you pass a table as parameter to a stored procedure. In order to use table-valued parameters you need to define a table type and then use the table type in the definition of the stored procedure. Let me illustrate this with the help of an example. I am going to first create a table type named Songs_TableType with two columns, Title and TrackNumber. Then I will use it in a stored procedure to pass a table as parameter.

Write Comment
Return to News

  Displaying 851 through 852 of 852
Prev | First
  The time now is 11:07:56 AM ET.
Any comment problems? E-mail us
#851 By 4240821 (77.110.107.199) at 4/15/2026 6:10:05 PM
https://telegra.ph/Trump-in-Hospital-Shocking-Details-Emerge-as-Former-President-Undergoes-Emergency-Treatment-04-05-2
https://telegra.ph/Breaking-Bad-The-Shocking-Truth-Behind-the-Most-Infamous-Drug-Empire-in-History-04-05-2
https://telegra.ph/Samir-Nasris-Shocking-Comeback-The-Legend-Returns-to-the-Premier-League-in-a-Stunning-Move-04-05
https://telegra.ph/Peaches-Geldof-The-Bold-New-Face-of-Global-Activism-04-05
https://telegra.ph/Halo-Campaign-Evolved-Xboxs-Legendary-Series-Reimagined-for-a-New-Era-04-05
https://telegra.ph/Halo-Campaign-Evolved-New-Strategies-Unveiled-in-Bold-Move-04-05
https://telegra.ph/Trump-in-Hospital-Shocking-Details-Emerge-as-Former-President-Undergoes-Emergency-Treatment-04-05
https://telegra.ph/76ers-Dominate-Pistons-in-Thrilling-Showdown-Clinch-Playoff-Spot-04-05
https://telegra.ph/Copenhagens-Radical-Climate-Pledge-Sparks-Global-BacklashIs-the-City-Overreaching-04-05
https://telegra.ph/Storm-Warning-Catastrophic-Winds-Slam-Coastal-Cities-as-Record-Rainfall-Floods-Streets-04-05

#852 By 4240821 (77.110.107.199) at 4/16/2026 3:00:53 PM
https://telegra.ph/Sunderland-vs-Brighton-Dramatic-Derby-Sets-the-Stage-for-a-Premier-League-Thriller-03-14
https://telegra.ph/Molde-Rosenborg-Shock-Europe-with-Unprecedented-Tactical-Masterclass-03-14
https://telegra.ph/Burnley-vs-Bournemouth-When-the-Flames-Meet-the-Ocean-on-the-Pitch-03-14
https://telegra.ph/Polestar-Accelerates-to-2026-Unveils-First-AllElectric-Sports-Sedan-Sparking-Global-Demand-Surge-03-14
https://telegra.ph/Atlético-Madrid--Getafe-Late-Volley-Sends-Red-Deer-to-Unlikely-Victory-03-14
https://telegra.ph/Girona--Bilbao-Duel-Sets-Stage-for-a-Historic-Football-Showdown-03-14
https://telegra.ph/Football-Club-Internazionale-Milano-Wins-Epic-Euro-Title-After-Stunning-Comeback-03-14
https://telegra.ph/Jordan-13-Chicago-Breaks-New-Ground-in-Latest-Sneaker-Drop-03-14
https://telegra.ph/Fierce-Fires-Fuel-Frenzied-Fatalities-Fire-Departments-Fail-to-Halt-the-Catastrophe-03-14
https://telegra.ph/Hacienda-Heist-Underway-Bank-Job-Told-to-Keep-Audits-at-Bay15-Million-Embezzled-in-Lavish-Offices-03-14

Write Comment
Return to News
  Displaying 851 through 852 of 852
Prev | First
  The time now is 11:07:56 AM ET.
Any comment problems? E-mail us
User name and password:

 

  *  
  *   *