How to Generate Unique ID in SQL Server – Programming, Pseudocode Example, C# Programming Example
Database SQL

How to Generate Unique ID in SQL Server

This post sbout how to generate a random unique identifier in using sql query in SQL server

If you want to generate a new Guid (uniqueidentifier) in SQL server the you can simply use the NEWID() function.

Example

You can directly use this with INSERT statement to insert new row in table.

 

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.