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)
 guaranteed uniqueness in integer column that is not an identity

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2003-04-07 : 07:44:10
Phil writes "Hi,

I would like to come up with a unique transaction number in a point of sale operation that is not an identity column. I had the idea of creating this unique field as a combination of the timestamp of transaction + the location + some random number.

Does anybody have experience in creating a 'user friendly' transaction number that is guaranteed uniqueness? This number will be stored in the database and possibly printed out on a receipt as well.


Thanks,
Phil"

nr
SQLTeam MVY

12543 Posts

Posted - 2003-04-07 : 09:40:30
You could always use an identity and prefix with the other fields for presentation.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

tacket
Starting Member

47 Posts

Posted - 2003-04-15 : 10:19:29
Can you expand on that further please?



Thanks,
Phil

Go to Top of Page
   

- Advertisement -