Code Snippet posted by:
Gopesh9 | Posted on: 8/14/2012 | Category:
SQL Server Codes | Views: 682 | Status:
[Member] |
Points: 40
|
Alert Moderator
If you want to generate new Guid i.e Unique Identifier in SQL Server, You can do that simply by using NEWID()
Example
DECLARE @CustomerID uniqueidentifier
SET @CustomerIDID = NEWID()
You can also use it when you want to insert the value in the database
insert into Customer(CustomerID, Name) values(NEWID(),'John')
G. S.
.Net Developer