Link to home
Start Free TrialLog in
Avatar of redflair
redflair

asked on

Multiple rows insert using Stored Procedure

Hello Experts,

I use ASP.net as the front-end and MS SQL 2008 as Database Server. I am a newbie, have been trying to write a stored procedure which should take list of rows as input and do bulk insert, all at once (no multiple INSERT INTO).

I read up on Bulk Insert, but that takes data from flat files which cannot help my case.

Is there a better way to do this? Appreciate any help!

Thank you.
Avatar of j_s_kelley
j_s_kelley

What is the source of the data.  When you say a "list of rows", what does that mean?  Is it a a list of rows from a database table?  Is the data in a file?  Has the data been input into a DataGridView?  The answer will help determine the best solution.
Avatar of Aneesh
you can pass the list of data as an xml
Avatar of redflair

ASKER

When you say a "list of rows", what does that mean?
Similar to Bulk Insert, I got to insert multiple rows at once.

Is it a a list of rows from a database table?
No

Is the data in a file?
No

Has the data been input into a DataGridView?  
Yes, user would enter values in DataGridView.
"you can pass the list of data as an xml "

Thank you, I can either use XML or CSV values as input for SP. But I would like to know how to do insert all records at once..
ASKER CERTIFIED SOLUTION
Avatar of redflair
redflair

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial