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.
LVL 3
redflairAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
redflairConnect With a Mentor Author Commented:
I could use Insert Into Values (set-1), (set-2).
0
 
j_s_kelleyCommented:
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.
0
 
Aneesh RetnakaranDatabase AdministratorCommented:
you can pass the list of data as an xml
0
 
redflairAuthor Commented:
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.
0
 
redflairAuthor Commented:
"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..
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.