开发者

SSIS Inserts 0 as a value in an identity column

we have this problem : in sqlserver 2005/2008 we create some new tabl开发者_C百科es with an integer identity column as the primary key : [Id] [int] IDENTITY(1,1) NOT NULL.

When loading data in this table via an SSIS dataflow task, SSIS should automatically fill the Id column. It does, BUT it starts at 0 in stead of 1. After that, when we delete all rows and do a checkident(reseed,0), we reload and it starts from 1 as it should. Any idea how we could get it right from the first time ?


Did you create the tables with the identity columns directly in SSMS? I've seen identity seeds start at 0 when using ERD tools to create the T-SQL DDL. Also, does it matter that the ID column starts at 1?


Is it possible that you have the option FastLoadKeepIdentity (oledb) or BulkInsertKeepIdentity (sql server) of the destination turned on?

If so, and you are mapping a source column to your destination id column, you could get the behavior you are describing.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜