Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 IDENTITY_INSERT

Author  Topic 

rajdaksha
Aged Yak Warrior

595 Posts

Posted - 2009-07-03 : 05:14:23
hi

I got this error While insert the data. please explain this....
Explicit value must be specified for identity column in table 'Table_Name' either when IDENTITY_INSERT is set to ON or when a replication user is inserting into a NOT FOR REPLICATION identity column.

RD

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-07-03 : 05:17:40
When inserting values to the table exclude identity column name

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-07-03 : 05:18:17
The "SET IDENTITY_INSERT <table> ON" means you are overriding the built-in mechanisms of setting a new value for the identity column.
Use a column list that includes the identity column.
And don't forget to turn the identity insert off immediately afterwards!


Microsoft SQL Server MVP

N 56°04'39.26"
E 12°55'05.63"
Go to Top of Page

rajdaksha
Aged Yak Warrior

595 Posts

Posted - 2009-07-03 : 05:34:41
Hi

SQL Server 2005 cannot automatically generate a unique identity value for an IDENTITY column for which the NOT FOR REPLICATION option is enabled. right
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-07-03 : 05:36:58
Yes it can.



Microsoft SQL Server MVP

N 56°04'39.26"
E 12°55'05.63"
Go to Top of Page
   

- Advertisement -