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
 Transact-SQL (2000)
 Autonumbering a String (varchar)...

Author  Topic 

ugpjava
Starting Member

4 Posts

Posted - 2005-09-06 : 22:17:11
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.

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2005-09-07 : 02:10:23
several options:
1. create two columns, one for the "A" part and the other for the automunber, then just combine when retrieving the rows
2. use computed columns, like in an instead of trigger
3. don't use autonumber, use an SP to generate that field



--------------------
keeping it simple...
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-09-08 : 02:58:15
Duplicate post
http://sqlteam.com/forums/topic.asp?TOPIC_ID=54868

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -