Friday 11 March 2016

What is Primary key Definition in Sql server , and how to create Primary Key in Sql Server ?

What is Primary key Definition in Sql server ,and how to create Primary Key in Sql Server ?


Definition of Primary Key :

Primary Key is a field in Relational Database Table that can Uniquely identified every record in the table.

Key Points :

-The Primary Key act as a Unique + Not Null Keys in Relational Database.

-The Primary doesn't  allows Null values and Duplicated values(repeated values) 

- We can create only one Primary Key for a table (entire table).

-When we create Primary key then it will automatically create Clustered Index for a table.

-Tables having primary key constraint are called as master tables(or) parent tables.

-in a table, a primary key can hold maximum of 32 columns(not  rows). 

-we can create primary key for table two ways .

          1.at the time of creating table (create table statement).

          2.at the time of (Alter)modifying table(alter table statement).

how to create primary key at table level and alter level go to next page.



Tags: Primary Key definition, How to create Primary Key, key points while creating Primary Key, What is Primary key Definition in Sql server , Primary Key is a field in Relational Database Table that can Uniquely identified every record in the table ,how to create Primary Key in Sql Server, primary key , foreign key, unique key, 

0 comments:

Post a Comment

 
Copyright © . MSBI SQL SERVER SSIS SSRS INTERVIEW TIPS - Posts · Comments
Theme Template by BTDesigner · Powered by Blogger