sql server - How large of a SQL string (for mass update) can I realistically use in C# .net4? -


i'm recieving , parsing large text file.

in file have numerical id identifying row in table, , field need update.

id       current location ========================= 1        boston 2        cambridge 3        idaho 

i thinking of creating single sql command string , firing off using ado.net, of these files i'm going recieve have thousands of lines. doable or there limit i'm not seeing?

if may have thousands of lines, composing sql statement not way go. better code-based alternatives include:

  1. use sqlbulkcopy insert change data staging table , update target table using staging table source. has excellent batching options (unlike other choices)

  2. write stored procedure update accepts xml parameter contains update data.

  3. write stored procedure update accepts table-valued parameter contains update data.

i have not compared them myself understanding #3 fastest (though #1 plenty fast need).


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -