1
Answer

I have a problem with identity column

vijay krish

vijay krish

12y
1.9k
1
i have a problem with identity column...i have two columns reg_series ans reg_number...i have set reg_series with current system date...and i have to get increment in reg_number based on reg_series...output shud be like this
reg_series   reg_number
20121116       1
20121116       2
20121116       3
20121116       4
20121117      1
20121117       2
20121117       3
 declare @date varchar(50)
set @date=convert(varchar(50),GETDATE(),112)


insert into data(Reg_Series) values(@date)

i have set reg_series with current system date...reg_number shud be auto generated based on reg_series value



Answers (1)