Search This Blog

Thursday, November 1, 2012

NEWID SQL Server

SQL Server > Built-In Functions > NEWID

Creates a unique value of type uniqueidentifier.

Example

DECLARE @myid uniqueidentifier
SET @myid = NEWID()

update
 user
set
 app_token = @myid
where
 id = 1