Thursday, November 29, 2007

Export table and data using SqlBulkCopy

i have one database to be exported and i try to use the import and export features from the sqlserver 2005. However i enconter one problem which is the primary key of the enabled indentity insert is all mess up after the importing to my new database. I just found and tested a utility and it works quite well.


method to export

generate a sql script with having the sql schema
use this program simple sql bulk copy downloadable from http://projects.c3o.com/files/default.aspx


ref:

http://msdn2.microsoft.com/en-us/library/system.data.sqlclient.sqlbulkcopy.aspx