Solved

can i pass a table to stored procedure

Posted on 2006-11-07
7
1,099 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 500 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

707 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now