first generate roll number like this..
1.) Right Click On the table Select Modify Table.
2.) Click on the Column you want to increment.
3.) In the column Property Window below click + of Identity Specification
4.) Make (Is Identity) from No to "Yes".
Thats It.
You can generate another way...You can write procedure like this...
Create PROCEDURE [dbo].PRocName
AS
BEGIN
SET NOCOUNT ON;
SELECT RIGHT(REPLICATE('0', 4) + CAST(CAST(COALESCE(MAX(autoGenerateColumnName), 0) AS INT) AS VARCHAR), 4) dcno
FROM
(
SELECT TOP 1 autoGenerateColumnName
FROM TableName
ORDER BY sno DESC
) q;
end
else
END