Wednesday, March 28, 2012

Ok to concat a Uniqueidentifier?

I want to use a NEWID() to generate order numbers, but i dont want to give customers the long uniqueID. so im wondering if i concatinate it to 8 characters, if that would be safe or not...

thx in advI don't understand
If you're trying to concatenate your "Long" uniqueID with 8 characters (in a new variable) what yould not be safe? I'm sure you wont be using the concatenated long-character string as a "Long" UniqueID!!|||i just dont want the variable to duplicaate or anything if i concat it.

of course there is a far greater chance with only 8 length.|||I would say it is not safe.

Why not use an autoincrementing integer field for Order ID?|||hm why didnt i think of that?

heh.

is there a way to make a field have 10 digits no matter what? meaning.....can i get a int field to contain 0000000001 in it?|||if not..i guess i could just start it at 10000000|||You should check the boundries , but you wont be needing that! you can use the auto increment method & show another value to the usersql

No comments:

Post a Comment