Tuesday, October 12, 2010
Tuesday, October 5, 2010
how to insert an identity value explicitly into a identity column in SqlServer
Step 1:- Set the IDENTITY_INSERT property for the desire table as On
Step 2:- Perform your insert operation
Step 3:- Set the IDENTITY_INSERT property for that particular table as off
Example are as folllows:-
SET IDENTITY_INSERT IdentityTable ON
INSERT IdentityTable(TheIdentity, TheValue)
VALUES (3, 'First Row')
SET IDENTITY_INSERT IdentityTable OFF
Step 2:- Perform your insert operation
Step 3:- Set the IDENTITY_INSERT property for that particular table as off
Example are as folllows:-
SET IDENTITY_INSERT IdentityTable ON
INSERT IdentityTable(TheIdentity, TheValue)
VALUES (3, 'First Row')
SET IDENTITY_INSERT IdentityTable OFF
Subscribe to:
Posts (Atom)