I write this stored procedure to modify the identity column depending on entered value it worked well just one time but now not work how can i fix this problem
it's apart of project that we need to change the start of id with the year
for ex : 200800023
tommorow we need to 200900001
Code:
create proc TickIDStart ( @IDnew int ) as BEGIN set nocount on -- Allow the insert in the identity column SET IDENTITY_INSERT TCKTs ON --Insert any data and delete it to adjust the identity column insert into TCKTs (TCKT_ID,TCKT_DESC, TCKT_SEVERITY_ID, Open_User_ID, RPT_USER_ID, TCKT_SUB_PROJ_ID) values (@IDnew,'text', 1, 1598,1610,122) delete from TCKTs where TCKT_ID= @IDnew --Disable the insert in the identity column SET IDENTITY_INSERT TCKTs Off END
for ex : 200800023
tommorow we need to 200900001
Comment