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 476 through 480 of 480
Prev | First
  The time now is 4:49:08 PM ET.
Any comment problems? E-mail us
#476 By 4240821 (142.252.120.118) at 3/31/2025 5:02:53 PM
https://telegra.ph/Stock-Market-Rollercoaster-Lessons-in-Timing-03-31
https://telegra.ph/Ukraine-Strikes-Russian-Oil-Refinery-NATO-Pledges-Support-03-31
https://telegra.ph/Michael-Jordans-Secret-Basketball-Adventure-03-30
https://telegra.ph/Ultra-Miami-Crypto-Investor-Disappearance-Mystery-03-28
https://telegra.ph/Hornets-Edge-Pelicans-in-Thrilling-Showdown-03-30
https://telegra.ph/Ex-Employee-Exposes-Restaurant-Chain-Scandal-03-28
https://telegra.ph/Wordle-Mystery-Shady-Clues-Lead-to-Solution-03-30
https://telegra.ph/Helen-Mirren-Honored-at-Cannes-Film-Festival-03-30
https://telegra.ph/Twitter-Down-Global-Chaos-and-Memes-03-30
https://telegra.ph/Chipotle-Rumors-Financial-Challenges-or-Misconception-03-28

#477 By 4240821 (142.252.120.118) at 4/1/2025 7:12:33 AM
https://telegra.ph/Michigan-Wolverines-Basketball-Locker-Room-Drama-03-29
https://telegra.ph/Celtics-Outlast-Grizzlies-in-Thrilling-Game-03-31-2
https://telegra.ph/Richard-Shermans-Comeback-to-Football-Glory-03-31
https://telegra.ph/Baton-Rouge-Weather-Sun-Rain-Sun-Again-03-31
https://telegra.ph/Taylor-Makars-Love-Triangle-Scandal-03-31
https://telegra.ph/Hornets-Edge-Pelicans-in-Overtime-Thriller-03-30
https://telegra.ph/Social-Security-COLA-Update-and-Information-03-29
https://telegra.ph/Helen-Mirren-and-Her-Missing-Oscar-Adventure-03-30
https://telegra.ph/Vietnam-Veterans-Day-Honors-Local-Heroes-03-29
https://telegra.ph/Mookie-Betts-Walk-Off-Grand-Slam-Heroics-03-29

#478 By 4240821 (142.252.120.118) at 4/1/2025 5:34:55 PM
https://telegra.ph/Braves-Sign-Stealing-Scandal-Exposed-04-01
https://telegra.ph/Wrexhams-Rise-to-Prominence-in-Football-03-29
https://telegra.ph/UConn-Womens-Basketball-Crisis-Looms-Large-03-30
https://telegra.ph/Helen-Mirren-and-Her-Missing-Oscar-Adventure-03-30
https://telegra.ph/U-of-M-Basketball-Suffers-Shocking-Loss-03-29
https://telegra.ph/Weather-Tomorrow-Shocking-Forecast-Uncovered-03-30
https://telegra.ph/Blues-Edge-Avalanche-in-Overtime-Thriller-03-29-2
https://telegra.ph/Tesla-Unveils-Affordable-Model-E-Electric-Car-03-31
https://telegra.ph/Tyreek-Hill-Signs-Record-Breaking-Dolphins-Contract-04-01
https://telegra.ph/Devils-vs-Wild-Game-Updates-Inquiry-03-29

#479 By 4240821 (195.208.3.43) at 4/3/2025 4:30:32 PM
https://telegra.ph/Chipotles-National-Burrito-Day-Crisis-03-31
https://telegra.ph/Mega-Millions-Powerball-Jackpots-Soar-Nationwide-03-30
https://telegra.ph/Nitish-Ranas-Domestic-and-IPL-Career-Update-03-30
https://telegra.ph/Jurickson-Profars-Heroic-Home-Run-Moment-03-31
https://telegra.ph/Deltarune-Chapter-3-Release-Date-Leaked-04-02
https://telegra.ph/Dak-Prescotts-Off-Season-Drama-Unveiled-04-01
https://telegra.ph/Megan-Thee-Stallion-Announces-New-Album-and-Tour-03-30
https://telegra.ph/Tre-Hollomans-Game-Winning-Dream-Come-True-04-01
https://telegra.ph/Ashwanis-Silent-Act-of-Family-History-03-31
https://telegra.ph/Surprising-Facts-About-Mortgage-Brokers-04-01

#480 By 4240821 (5.252.188.174) at 4/4/2025 2:21:50 AM
https://telegra.ph/Utah-Survives-Butlers-Late-Rally-03-31
https://telegra.ph/Fascinating-Facts-About-Pixie-Dust-04-02
https://telegra.ph/Maxs-Secret-Spot-for-Perfect-Scratches-03-31
https://telegra.ph/Jonathan-Groffs-Secret-Life-and-Hollywood-Drama-04-01
https://telegra.ph/Weather-Chaos-in-NYC-Time-Displaced-Storms-04-03
https://telegra.ph/Utah-Jazz-vs-Charlotte-Hornets-Analysis-04-01
https://telegra.ph/Power-Outage-Chaos-Sparks-Citywide-Panic-04-03
https://telegra.ph/Bitcoin-Pump-and-Dump-Heist-Exposed-04-02
https://telegra.ph/NYT-Connections-Hints-Spark-Player-Frustration-04-03
https://telegra.ph/Tornado-Warning-Tests-NJ-Community-Spirit-04-01

Write Comment
Return to News
  Displaying 476 through 480 of 480
Prev | First
  The time now is 4:49:08 PM ET.
Any comment problems? E-mail us
User name and password:

 

  *  
  *   *