Logo 
Search:

SQL Server Articles

Submit Article
Home » Articles » SQL Server » System FunctionsRSS Feeds

NEWID Function

Posted By: Sarita Patel     Category: SQL Server     Views: 2266

This article explains about NEWID function in sql server with examples.

NEWID function is used to get unique value of type uniqueidentifier.

It is a nondeterministic means It returns different values every time it is called.


Syntax of NEWID Function :

NEWID ()

Return type of NEWID function is a uniqueidentifier.




Examples of NEWID Function :

Example 1 : Use of NEWID function in select clause 

SELECT NEWID ()

Output
BAF64B1B-9646-4AAD-8AC0-799CF6D95EDD

Above example returns unique id.
  
Share: 

 
 
 

Didn't find what you were looking for? Find more on NEWID Function Or get search suggestion and latest updates.

Sarita Patel
Sarita Patel author of NEWID Function is from United States.
 
View All Articles

Related Articles and Code:


 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!