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 RajputRank #616 · 3.9K reputationPosted Apr 1, 2015, 11:06 PM EDT
//insert or modify query
SET IDENTIY_INSERT tblname OFF
Vishnu BhangaleRank #9,687 · 203 reputationPosted Apr 1, 2015, 11:26 PM EDT
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 RajputRank #616 · 3.9K reputationPosted Apr 2, 2015, 1:23 AM EDT
SET IDENTITY_INSERT tblname ON
//insert or modify query
SET IDENTITY_INSERT tblname OFF