Wednesday, 11 July 2018

SQL Server : Script to find out all tables in our database which do not have primary key

Primary Key is the most important aspect in designing our Database or Table. One should always use one in each and every user-defined Table in our Databases. If in case you do not need one, you should define an auto-incremented column as 'SerialNumber' or 'RowNumber'. It is a good practice. But the Question arouses how will I see in Database which Tables do not have Primary Key.to solve this Problem, Here is the Script :



Happy Coding !!!

No comments:

Post a Comment

SQL Audits

1. sys.server_audits What it is: Lists all server-level audit objects . An audit is the top-level object that defines: Where to wri...