Fast batch insert/update with SQL Server 2008 and BCP -
i'm not sql programmer, i've got basics, i've heard of bcp thing fast data loading. i've searched internet , seems command-line utility, , not can use in code.
the thing is, want able make fast inserts , updates in sql server 2008 database. have function in database accept:
- the name of table want execute insert/update operation against
- the names of columns i'll feeding data to
- the data in csv format or sql can read stupid-fast
- a flag indicating weather function should perform insert or update operation
this function read csv string , genarate necessary code inserting/updating table.
i write code in c# call function passing table name, column names, list of objects serialized csv string , insert/update flag.
as can see, intended both fast , generic, suitable project dealing large amounts of data, , candidate company's framework.
am thinking right? idea? can use bcp thing, , suitable every case?
as can see, need directions on this... in advance help!
in c#, @ sqlbulkcopy. it's ssis uses in background.
for true bcp/bulk insert, you'd need bulkadmin rights may not allowed
Comments
Post a Comment