I am Inserting Records in 14 tables
By using loop and condition i am inserting this records
this cause slowness in my form submission
Pls Guide me
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Dhirendra MisraPosted Jan 6, 2014, 11:48 PM
If you are using SQL Server 2008 and framework version 3.5, you can make use of "Table-Valued Parameters" and make collection of values in table and pass it to Stored Procedure. The stored procedure should have all condition to insert the data at respective tables.
Detail description about table-valued parameter can be found here:
http://msdn.microsoft.com/en-us/library/bb675163(v=vs.110).aspx
There is option of bulk insert as well but it needs single table where data needs to be persisted. Have a look at the link below it may be a thing of your interest.
http://www.morgantechspace.com/2013/08/bulk-insert-records-into-sql-server.html
Thanks