Showing posts with label force. Show all posts
Showing posts with label force. Show all posts

Monday, March 12, 2012

identity insert

is there any way to force mssql to insert user defined value in identity column?check out SET IDENTITY_INSERT in books on line.

assume a table called ABC and the xyz field is an identity...

SET IDENTITY_INSERT ABC on
insert into ABC (xyz, filed2, field3, ...)
select 14, 'A','B',...
SET IDENTITY_INSERT OFF