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)
 Format an Increment Value

Author  Topic 

cindylee
Yak Posting Veteran

55 Posts

Posted - 2005-06-26 : 22:24:27
Hi guys
I have column of data type int with increment option.
I need to include a text "log" before this int.
for ex:
log1
log2
log3
I used to do this in MS Access (using format option in autonumber).
Can anyone let me know how to do it in sql server?

Many thanks
cindy

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-06-27 : 01:19:23
I wonder if there is such a method in SQL Server
Keep it as it is. In your presentation layer show that number by formatting it

Madhivanan

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

AndyB13
Aged Yak Warrior

583 Posts

Posted - 2005-06-27 : 02:39:31
Have a look at this article
http://www.sqlteam.com/item.asp?ItemID=1417

Or you could store the prefix in a different column if they can be different

Or do as madhivanan said and keep it to your presentation layer

Andy

Beauty is in the eyes of the beerholder
Go to Top of Page
   

- Advertisement -