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.
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.
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.
you can pass the list of data as an xml
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.
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.
ASKER
"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..
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.