Globally Unique Identifier (GUID) in C# - Tips and Tricks
A GUID is a 128-bit integer (16 bytes). GUID is Globally Unique Identifier. programmers can use this key as unique Key We can generate Guid using C#Guid objGuid=Guid.NewGuid();
string uniqueID=objGuid.ToString();
select uuid(); function
A UUID is designed as a number that is globally unique in space and time.why not use GUIDs?
Mostly because GUIDs are big, and they index badly in MySQL.
Although UUID() values are intended to be unique, they are not necessarily unguessable or unpredictable. If unpredictability is required, UUID values should be generated some other way.
Uuid()+ rand()
If we can’t make MySQL auto-increments work across multiple databases, what if we just used one database? If we inserted a new row into this one database every time someone uploaded a photo we could then just use the auto-incrementing ID from that table as the primary key for all of our databases.
Maximum Length 36
declare @eid uniqueidentifier
set @eid= NEWID();
select @eid, LEN(@eid);
Although UUID() values are intended to be unique, they are not necessarily unguessable or unpredictable. If unpredictability is required, UUID values should be generated some other way.
Uuid()+ rand()
If we can’t make MySQL auto-increments work across multiple databases, what if we just used one database? If we inserted a new row into this one database every time someone uploaded a photo we could then just use the auto-incrementing ID from that table as the primary key for all of our databases.
Maximum Length 36
declare @eid uniqueidentifier
set @eid= NEWID();
select @eid, LEN(@eid);
No comments:
Post a Comment