Comment obtenir toutes les tables qui n’ont pas de clé primaire dans SQL Server ?

0
228

SELECT name AS Table_Name
FROM sys.tables
WHERE OBJECTPROPERTY(OBJECT_ID,’TableHasPrimaryKey’) = 0
ORDER BY Table_Name;

LEAVE A REPLY

Please enter your comment!
Please enter your name here