sql server - Combine two columns of a table in third column -
i want create table wherein 'id' column combined 'category' column , gets stored in 'userid' column. here example.
id category userid 1 std std1 2 nmm nmm2 3 cov cov3
i have tried :
create table tblusers ( id int identity primary key, regid right('0000'+cast([id] varchar(5)),5), category nvarchar(3), userid concat(categoryinitials,id) )
but doesnt work. so, how work while creating table?
may this:
create table tblusers ( id int identity primary key, category nvarchar(3), userid (category + cast(id varchar(10))) )
Comments
Post a Comment