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 2005 Forums
 Transact-SQL (2005)
 newid()

Author  Topic 

soorajtnpki
Posting Yak Master

231 Posts

Posted - 2008-12-01 : 04:17:00
hi all
select newid()
gives id which depends on the system/server generated.
How it is created, what parameters it use..

thanx.

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-12-01 : 04:21:32
it doesnt have any parameters. NEWID() just returns a unique random GUID value each time which will vary from machine to machine
http://doc.ddart.net/mssql/sql70/na-nop_2.htm
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-12-01 : 04:35:00
and you can use it to generate rows randomly

select top 10 * from table order by newid()

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -