create table autonumberid( id int identity, categoryid as(right('0000'+CONVERT([varchar],[id],0),(4))), productname varchar(20) )
SELECT RIGHT ('0000'+ CAST (@Number AS varchar), 4)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)