Text version of the video
http://csharp-video-tutorials.blogspo...
Healthy diet is very important both for the body and mind. If you like Aarvi Kitchen recipes, please support by sharing, subscribing and liking our YouTube channel. Hope you can help.
/ @aarvikitchen5572
Slides
http://csharp-video-tutorials.blogspo...
All SQL Server Text Articles
http://csharp-video-tutorials.blogspo...
All SQL Server Slides
http://csharp-video-tutorials.blogspo...
All SQL Server Tutorial Videos
• SQL Server tutorial for beginners
All Dot Net and SQL Server Tutorials in English
https://www.youtube.com/user/kudvenka...
All Dot Net and SQL Server Tutorials in Arabic
/ kudvenkatarabic
In this video we will discuss
1. What is a GUID in SQL Server
2. When to use GUID
3. Advantages and disadvantages of using a GUID
What is GUID data type in SQL Server
The GUID data type is a 16 byte binary data type that is globally unique. GUID stands for Global Unique Identifier. The terms GUID and UNIQUEIDENTIFIER are used interchangeably.
To declare a GUID variable, we use the keyword UNIQUEIDENTIFIER
Declare @ID UNIQUEIDENTIFIER
SELECT @ID = NEWID()
SELECT @ID as MYGUID
How to create GUID in sql server
To create a GUID in SQL Server use NEWID() function
For example, SELECT NEWID(), creates a GUID that is guaranteed to be unique across tables, databases, and servers. Every time you execute SELECT NEWID() query, you get a GUID that is unique.
Example GUID : 0BB83607-00D7-4B2C-8695-32AD3812B6F4
When to use GUID data type : Let us understand when to use a GUID in SQL Server with an example.
For example code used in the demo please refer to the following article
http://csharp-video-tutorials.blogspo...
The main advantage of using a GUID is that it is unique across tables, databases and servers. It is extremely useful if you're consolidating records from multiple SQL Servers into a single table.
The main disadvantage of using a GUID as a key is that it is 16 bytes in size. It is one of the largest datatypes in SQL Server. An integer on the other hand is 4 bytes,
An Index built on a GUID is larger and slower than an index built on integer column. In addition a GUID is hard to read compared to int.
So in summary, use a GUID when you really need a globally unique identifier. In all other cases it is better to use an INT data type.
Auf dieser Seite können Sie das Online-Video Guid in SQL Server mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer kudvenkat 09 März 2017 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 59,357 Mal angesehen und es wurde von 492 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!