views:

158

answers:

1

hi,

i used 'SET IDENTITY_INSERT OFF' and this is executing successfully but in the table still identity on only

please help any one

+6  A: 

This is going to drive you crazy but to do what you want use

SET IDENTITY_INSERT ON

This article explains it.

The gist is that however misguided the decision, someone made the call that this statement would refer to whether your scripts could alter the identity column. Rather backwards, but that's just the way it is :D

Michael La Voie
Yes, setting it to ON means it allows you to insert identity column value manually. OFF = auto insert by the system.
o.k.w