Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

can i pass a table to stored procedure

Posted on 2006-11-07
7
Medium Priority
?
1,109 Views
Last Modified: 2012-05-05
I do want to do a bulk insert into database, like 2000 records at a time. Can I pass a datatable to stored procedure and then insert them into destination table all at a time.
0
Comment
Question by:cognos79
  • 3
7 Comments
 
LVL 12

Expert Comment

by:Einstine98
ID: 17893330
I normally do it with XML documents...

1. Pass your data as an xmal document(table)...
2. Parse it to a temp table.
3. insert/update or whatever...

Will post you a link soon...
0
 
LVL 13

Expert Comment

by:devsolns
ID: 17893335
Are you doing this load from another application or through TSQL?  This is mainly a design question.  If this is being done over and over again you may want to do some type of bulk load (see http://www.sqlteam.com/item.asp?ItemID=3207).  Other wise ADO (in .NET) will handle this insert pretty easily without a major datbase performance impact.

Hope this helps.

--DS
0
 
LVL 12

Accepted Solution

by:
Einstine98 earned 2000 total points
ID: 17893350
0
 
LVL 3

Author Comment

by:cognos79
ID: 17893472
Einstine98 can you post the link please....
0
 
LVL 12

Expert Comment

by:Einstine98
ID: 17895051
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question