Explain PRIMARY KEY constraint in SQL Server.
The PRIMARY KEY ,
• is used to uniquely identify the records in a table.
• it should not contain NULL values.
• each table should have a PRIMARY KEY.
• each table can have only one PRIMARY KEY.
Ex :
Create Table Suppliers
(
Supplier_ID int NOT NULL PRIMARY KEY,
Supplier_Name varchar (300) NOT NULL,
Address varchar (500),
City varchar (200)
)
This Query creates PRIMARY KEY on the “Supplier_ID” column in suppliers table.
3 Comments:
I can see that you are are genuinely passionate about this! I am trying to build my own website and youve helped me with some great information
http://www.sqlservermasters.com/
Thanks for the interesting read!
best gadget reviews
Interesting! thanks for sharing this explanation guide in Primary Key. Looking forward for your next post.
Server Racks | Racks And UPS
Post a Comment
Subscribe to Post Comments [Atom]
<< Home