From the course: Developing Microsoft SQL Server 2016 Databases
Unlock this course with a free trial
Join today to access over 25,500 courses taught by industry experts.
Add GUID data to a table - SQL Server Tutorial
From the course: Developing Microsoft SQL Server 2016 Databases
Add GUID data to a table
- [Instructor] Sometimes multiple database systems will create similar record sets that will eventually have to be pulled together into a single table. For instance, if servers on opposite sides of the country are collecting order information from customers in their region. When a standard integer field is used as an identifier and a primary key for the table, this can cause issues, since both systems will be generating the same primary key values. To get around this, SQL server supports a unique identifier data type. This data type stores a 16-byte globally unique identifier, or GUID, and no two systems will ever generate the same values. By using a GUID as a primary key, tables created at multiple locations can easily be merged together without fear of duplicating key values. Let's take a look by creating a new database called GlobalIdentifier. Then, we're going to create a data table called Products. The first column is…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.