Is there anyway to insert in bulk a System.Data.DataTable in C# into a SQL Server table using a store procedure and passing this table as parameter?
The table won’t have a fixed number of records.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes there is a way:
Please experiement with the BatchSize – 100000 was good for me – it should not be larger than that – speed migth decrease otherwise. BatchSize does not limit your data – it’s just the size of each “packet” that will be sent to the sql server.
SiteSQLServer should be inside your app.config or web.config. You need to change the parameters here if not.
Please change MYTABLE to your table name.