SQL Server Transact Basic to Expert - Create Table Query With Primary Key

This blog shows how to create a table with a primary key enforced.

Syntax:

Create table TableName
(Column1 datatype Null/NotNull Primary Key,
 Column2 datatype Null/Notnull)

Example:

Create Table emptable
(Empid int Not Null Primary Key,
 Empname Varchar(50) Not Null)
Ebook Download
View all
Learn
View all