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 create GUID( globally unique identifier)?

Author  Topic 

samsun125
Yak Posting Veteran

63 Posts

Posted - 2008-11-27 : 08:09:47
Hi all,

in my table i.e tbluserinformation,in this columns are
1.username.password 3.firstname 4.city 5.state 6.country 7.zip 8.emailid 9.tel1 10.rowid

what is my doubt is if user insert a row(his profile) i want to create one GUID(globally unique identifier)for each user .
but i don't have any field name like that .
can u please give me one idea,how to generate guid for that insertion time

Regards
RamaDevi

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-11-27 : 08:16:27
You can make column 10 with NEWSEQUNTIALID() or NEWID() as default value.



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

sunsanvin
Master Smack Fu Yak Hacker

1274 Posts

Posted - 2008-11-28 : 01:46:48
select newid() .... you can get newid

while insertion,...
insert into <table_name> your_column_data1, your_column_data2,newid(), your_column_data3, like that

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

samsun125
Yak Posting Veteran

63 Posts

Posted - 2008-11-28 : 01:53:45
Thank you Peso and Sunsanvin.

Regards
Rama.
Go to Top of Page
   

- Advertisement -