How to check a primary key exists or not in table

IF OBJECTPROPERTY( OBJECT_ID( '[dbo].[Customers]' ), 'TableHasPrimaryKey' ) = 1
PRINT '[dbo].[Customers] table has a primary key.

0 Comments

Featured Post

How to Get an Free Azure Subscription for Learning

Whether you're a student, beginner, or professional looking to upskill with Microsoft Azure, here are 3 ways to get started with zero ...

MSDEVBUILD - English Channel

MSDEVBUILD - Tamil Channel

Popular Posts