Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Autonumbering...

Author  Topic 

ugpjava
Starting Member

4 Posts

Posted - 2005-09-06 : 22:03:03
To Autonumbering in MS-SQL i used this...

custNo int IDENTITY(100,1) //it works...OK
100
101
102
103
...
..


Thing is..How can i generate a autonumbered String...
Like,

A100
A101
A102
A103
...
..
.

thanks.

derrickleggett
Pointy Haired Yak DBA

4184 Posts

Posted - 2005-09-07 : 00:21:54
How do you know what letter to use? What's the business rule governing how high the numbers go and when the letters change? You might want to just have two seperate columns and combine them for reporting, apps, etc. You could also look at computed columns, a single point of entry proc, etc. It really depends on what you're trying to accomplish. Make sense?

MeanOldDBA
derrickleggett@hotmail.com

When life gives you a lemon, fire the DBA.
Go to Top of Page

AjarnMark
SQL Slashing Gunting Master

3246 Posts

Posted - 2005-09-07 : 13:17:10
This article might also be of help.

---------------------------
EmeraldCityDomains.com
Go to Top of Page
   

- Advertisement -