开发者

pushing a datatable from memory into SQL server using ADO.NET

开发者 https://www.devze.com 2023-01-12 23:38 出处:网络
I have a datatable in mem开发者_Python百科ory that I got from a non SQL source. What is the most elegant way, using ADO.NET to push it \"as is into a new SQL (2005) server table?You\'d need to do this

I have a datatable in mem开发者_Python百科ory that I got from a non SQL source.

What is the most elegant way, using ADO.NET to push it "as is into a new SQL (2005) server table?


You'd need to do this as a series of steps. Firstly, creating the table via some dynamic SQL. Then you'd need to load the information from memory into the newly created table, potentially using a BULK INSERT.


Or create the table on the SQL Server, read one row at a time, and add it to the table.


  • CREATE TABLE based on the structure
  • SQLBulkCopy it
0

精彩评论

暂无评论...
验证码 换一张
取 消