SQL Server NEWID function is a system function that is used to generate a random unique value of type uniqueidentifier.
SYNTAX
NEWID()
A return type of NEWID function is uniqueidentifier.
Uniqueidentifier is a Microsoft SQL Server data type that is used to store Globally Unique Identifiers (GUIDs).
It can store 16 bytes of data.
Following is the valid format data value of type uniqueidentifier.
xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Here x is a hexadecimal digit in the range 0-9 or a-f.
Lets look at an example of NEWID() in SQL Server.
Generate random unique id using NEWID Function
select newid() as uniqId

Using NewID function with variable
DECLARE @uniqid uniqueidentifier SET @uniqid = NEWID() Select @uniqId as UniqId

Variable declaration to store the value generated by NEWID function
You can store the value generated by NEWID function in variable, for this you need to declare a local variable of type uniqueidentifier, then assigned a value to it by using SET statement as shown below.
DECLARE @uniqid uniqueidentifier ; SET @uniqid = '97125ECE-EE01-4F23-89B7-5C425EC53BF7'; SELECT @uniqid as uniqId

Convert uniqueidentifier generated by NEWID function to Integer value
SELECT CAST(CAST(NEWID() AS VARBINARY) AS INT) AS UniqId

SELECT ABS(CAST(CAST(NEWID() AS VARBINARY) AS INT)) AS UniqId_positive

NEWID function with create table statement
CREATE TABLE dbo.Demo ( DemoId uniqueidentifier NOT NULL DEFAULT NEWID(), DemoName varchar(150) ) INSERT INTO dbo.Demo (DemoName) VALUES ('Demo On - Logistic Track Management')
As you have created a table and inserted one record in table, lets select the record from a table to see whether a Unique Id value is generated for column DemoId or not.

Also Read
9,150 total views, 5 views today
Newid creates a random value and creates too much of fragmentation if used as primary key. New sequencial ID is a better option.
¿La función nunca devuelve un valor igual a otro ya arrojado en el pasado?
As per microsoft documentation on UniqueIdentifier, This value is always a unique globally beacuse it is generate based on network clock and CPU clock time