Link to home
Start Free TrialLog in
Avatar of mordi
mordiFlag for Israel

asked on

Generate newid() uniqueidentifier as a char(16) field

I need to generate a 16 digits universal unique alphanumeric number.
I tried to do it using newid() function  and save it in a char(16) field but it doesn't work.
Any other ideas?
ASKER CERTIFIED SOLUTION
Avatar of Gustavo Perez Buenrostro
Gustavo Perez Buenrostro

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mordi

ASKER

To use the full universal capability of the newid function, i have to convert every 2 digits(hex) of the 32 that the function returns, to one digit, and thus converting to a 16 digit guid.
Can you help?