Hello,
i create the table with Id name and Date column and set identity to Id my task is when
i insert name on same date the identity increamented when i change the date
and enter name the id column identity reset and when we go in previous date and suppose my last column of that date is 100 and i
insert name in that date value of my id is 101 means which is again auto increament
i insert name on same date the identity increamented when i change the date
and enter name the id column identity reset and when we go in previous date and suppose my last column of that date is 100 and i
insert name in that date value of my id is 101 means which is again auto increament
Khargesh RajputPosted Apr 2, 2015, 5:23 AM
SET IDENTITY_INSERT tblname ON
//insert or modify query
SET IDENTITY_INSERT tblname OFF
Vishnu BhangalePosted Apr 2, 2015, 3:26 AM
if(@date>=GETDATE())
begin
--DBCC CHECKIDENT ('ResetIdentity', RESEED, 1)
set IDENTIY_INSERT ResetIdentity ON
insert into ResetIdentity values('xyz','2015-03-05')
end
it gives error like
'IDENTIY_INSERT' is not a recognized SET option.
Khargesh RajputPosted Apr 2, 2015, 3:06 AM
//insert or modify query
SET IDENTIY_INSERT tblname OFF