Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2005 > SQL Server 2005
|
SQL Server 2005 General discussion of SQL Server *2005* version only.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 8th, 2007, 04:09 PM
SQLScott's Avatar
Wrox Author
 
Join Date: Dec 2004
Posts: 338
Thanks: 0
Thanked 2 Times in 2 Posts
Default Passing and Inserting mutliple rows at once

I'm not sure how to discribe this but i'll give it my best shot.

I know SQL Server can insert multiple rows at once, but where I need some assistance is how to pass that data to a stored procedure. I have a form with a grid in my application, and for each row selected in the grid, I want to pass all selected rows at once to a stored proc and have them inserted.

I don't want to insert one row at a time because that would entail caling the stored proc multiple times.

How can I pass multiple records to a stored proc and have them inserted? once all the records are in the proc, I don't care how the inserts are done, whether it be one large insert or looping through and inserting (although, one large insert would be more efficient).

Thanks...


Scott Klein
Author - Professional SQL Server 2005 XML
http://www.wrox.com/WileyCDA/WroxTit...764597922.html
__________________
========================
Scott Klein
Author of:
Professional SQL Server 2005 XML
Professional WCF Programming: .NET Development with the Windows Communication Foundation
Professional LINQ
========================
 
Old February 10th, 2007, 09:41 AM
SQLScott's Avatar
Wrox Author
 
Join Date: Dec 2004
Posts: 338
Thanks: 0
Thanked 2 Times in 2 Posts
Default

I figured it out. If anyone wants to know how, let me know...

Scott Klein
Author - Professional SQL Server 2005 XML
http://www.wrox.com/WileyCDA/WroxTit...764597922.html
 
Old February 12th, 2007, 03:04 AM
Friend of Wrox
 
Join Date: Oct 2006
Posts: 475
Thanks: 0
Thanked 9 Times in 9 Posts
Default

Well, hell yeah... What did you do?

--Jeff Moden
 
Old February 12th, 2007, 10:57 AM
Registered User
 
Join Date: Jan 2007
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I'm with Jeff on this. How'd you do it?

Daniel Periut

 
Old February 12th, 2007, 11:10 AM
SQLScott's Avatar
Wrox Author
 
Join Date: Dec 2004
Posts: 338
Thanks: 0
Thanked 2 Times in 2 Posts
Default

OK, let me get all the info together and I'll post it shortly...

Scott Klein
Author - Professional SQL Server 2005 XML
http://www.wrox.com/WileyCDA/WroxTit...764597922.html





Similar Threads
Thread Thread Starter Forum Replies Last Post
Inserting multiple rows from datagrid to database ashish0512 ASP.NET 1.x and 2.0 Application Design 2 August 25th, 2012 02:09 AM
Automatically inserting rows at varied intervals Peskarik Excel VBA 0 August 14th, 2008 02:24 AM
Gridview and inserting rows thewoodchuck BOOK: Professional ASP.NET 3.5 : in C# and VB ISBN: 978-0-470-18757-9 0 April 10th, 2008 09:55 AM
Problem while inserting rows!! raman1 PHP Databases 0 April 16th, 2005 12:03 AM
creating a table and inserting rows. sasidhar79 Classic ASP Databases 2 July 28th, 2004 03:09 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.