//自增列重新生成:SqlBulkCopy bc = new SqlBulkCopy(conn) //自增列保留原值:SqlBulkCopy bc = new SqlBulkCopy(conn,SqlBulkCopyOptions.KeepIdentity) using(SqlBulkCopy sbc = new SqlBulkCopy(conn,SqlBulkCopyOptions.KeepIdentity)) { sbc.DestinationTableName = tableName; f…
预置条件: 使用sa帐号登录SQL Server Management Studio,右键点击安全性-登录名-数据库用户名属性,设置服务器角色为sysadmin. 删除已存在的存储过程 String JOB_BCP_DELETE_SQL = “IF EXISTS (SELECT * FROM sys.objects WHERE name = 'PROCEDURE_BCP_OUT' AND type in (N'P', N'PC'))\n DROP PROCEDURE PROCEDURE_BCP_…