Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all
Can anyone help me out how to create userdefined auto generated coumn in sql server,
I want to create a column with values like "HKL1" like this the "1" should increament automatically like 2,3,4, so on.........

Thank you in advance
Posted
Comments
virang_21 11-Jun-13 1:33am    
You can use the insert trigger on the table to generate the ids.
damodara naidu betha 12-Jun-13 2:29am    
You can set identity on your column with seed "1". Please go through this link http://msdn.microsoft.com/en-us/library/aa933196(v=sql.80).aspx

1 solution

Please see the following, might be helpful.
Auto generated sequence number in SQL Server[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900