What you can do is have an identity column that is an integer. You can make this identity column start at 82300001 and increment by one. Then, you could create a computed column that preprends the 'U'.
For Example:
Code:
Create Table InterestingIdentity(RowId Int Identity(82300001,1), Data VarChar(20), Id As 'U' + Convert(VarChar(8), RowId))
Now, when you use this table:
Code:
Insert Into InterestingIdentity(Data) Values('Blue')
Insert Into InterestingIdentity(Data) Values('Red')
Select * From InterestingIdentity
To clean up:
Code:
Drop Table InterestingIdentity
As you can see, there is a real integer identity column that handles the number part, and a computed column that handles the 'U' + Number part.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.