set column autogenerate numbers
i have a table with column student_id as primary key, also i have another column which is student admission number i want after every registration adm_no to move to next number without skipping , how can i do it
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sibeesh VenuPosted May 25, 2015, 7:27 AM
(
GRNo INT IDENTITY(1,1) NOT NULL,
SecondColumnName VARCHAR(100),
OtherColumnsName VARCHAR(100),
BillNo AS ( 'B' + CAST( GRNo AS varchar(max) ) ) -- filling the value by computing B1 if GRNo is 1
-- OR Simply
-- BillNo AS (GRNo ) -- filling with GRNo
)