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
 General SQL Server Forums
 New to SQL Server Programming
 how to generate guid in sql server

Author  Topic 

pujitha
Starting Member

1 Post

Posted - 2008-06-11 : 00:06:18
Dear Expert,
Iam new to sql server2000

I have table Table1 in that table I want to generate unique guid in one column.I want the code for that one kindly help me.

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-06-11 : 00:14:04
use NEWID() function to create unique guid and amke a default for column on it

CREATE TABLE
(uidCol uniqueidentifier DEFAULT NEWID(),
...)
Go to Top of Page

sunsanvin
Master Smack Fu Yak Hacker

1274 Posts

Posted - 2008-06-11 : 00:41:41
Dear Puji,
use like this
select newid()
go
that will give you a newid. so copy that and paste.
vinod

Arnav
Even you learn 1%, Learn it with 100% confidence.
Go to Top of Page
   

- Advertisement -