PRINT '[dbo].[Customers] table has a primary key.
Azure
How to check a primary key exists or not in table
By
Friday, January 21, 2011
comments
React:
IF OBJECTPROPERTY( OBJECT_ID( '[dbo].[Customers]' ), 'TableHasPrimaryKey' ) = 1
PRINT '[dbo].[Customers] table has a primary key.
PRINT '[dbo].[Customers] table has a primary key.
Suthahar Jegatheesan
Cloud, AI & Mobile Solutions Architect · 18+ years across Azure, Google Cloud and Firebase, C#, Python, .NET MAUI and Flutter. Author of the Xamarin Q&A Book.
More in this series
Related articles
No comments: