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)
 Create a GUID in stored proc

Author  Topic 

pithhelmet
Posting Yak Master

183 Posts

Posted - 2007-10-16 : 14:06:42
Hi everyone -

I need to generate a GUID and save it into a varchar temporary variable....

what is the proper way to accomplish this???

thanks
tony

dinakar
Master Smack Fu Yak Hacker

2507 Posts

Posted - 2007-10-16 : 14:44:48
use NEWID()


Declare @var varchar(50)
Set @var = newid()
select @var


Dinakar Nethi
************************
Life is short. Enjoy it.
************************
http://weblogs.sqlteam.com/dinakar/
Go to Top of Page

pithhelmet
Posting Yak Master

183 Posts

Posted - 2007-10-17 : 11:40:15
fantastic -

thank you
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-10-17 : 11:50:53
The wonders of Books Online and Dinakar are marvelleous.



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

dinakar
Master Smack Fu Yak Hacker

2507 Posts

Posted - 2007-10-17 : 12:20:00
quote:
Originally posted by Peso

The wonders of Books Online and Dinakar are marvelleous.



E 12°55'05.25"
N 56°04'39.16"




this is better..

Dinakar Nethi
************************
Life is short. Enjoy it.
************************
http://weblogs.sqlteam.com/dinakar/
Go to Top of Page
   

- Advertisement -