From the course: Microsoft SQL Server 2022 Essential Training

Unlock this course with a free trial

Join today to access over 24,100 courses taught by industry experts.

Primary key fields

Primary key fields

- [Instructor] If I open the Red30 Tech customers table in the design tool again, we'll see that we now have the customer ID column created that's automatically generating unique identifiers for each customer that we enter into the table. Because unique record identifiers are so core to the functionality of a relational database, we can take the concept one step further and tell SQL Server that even though there may be other columns in the table that store unique values, this column in particular is the most important. We do this by designating the column as the table's primary key. To see what this means, let's go ahead and open up the customer's data. I'll right click on it and choose select top 1000 rows. Now, the reason we designate a primary key column is so that we can know without a doubt that we will always have a way of finding specific records of interest. If we were to search through our customer's table by the…

Contents