Quantcast
Channel: Forum SQL Server Database Engine
Viewing all articles
Browse latest Browse all 15889

Is Primary Key is mandatory

$
0
0
Hello DBA and Experts

Is Primary Key mandatory for all tables?

I have a reporting database just for reports.
There are SSIS jobs which downloads data from Transaction database to reporting database.
I have 5 tables in reporting database with no primary key hence no clustered index.
Is it really mandatory to have primary key.

Example
A master table say EmployeeMaster with columns PK_EmpID, EmpName and with clustered index on column PK_EmpID

There is other table say EmployeeAddress with columns FK_EmpID, City with no clustered index but non-clustered index on column FK_EmpID which is a foreign key reference to EmployeeMaster.PK_EmpID

In my report SQL queries when I need to SELECT data from EmployeeAddress, I always join EmployeeMaster with EmployeeAddress on EmployeeAddress.FK_EmpID = EmployeeMaster.PK_EmpID.

My question, do I really need a Primary key on table EmployeeAddress though no where I am using it?
I am looking for better option from performance point of view.
In the tables there will be upto 1 lakh records.

Thank you, in advance.



Viewing all articles
Browse latest Browse all 15889

Trending Articles