quarta-feira, 10 de setembro de 2014

Listing all tables that dont have Primary Keys! Listando todas as tabelas que não tem PK no SQL SERVER!

Listing all tables that dont have Primary Keys! Listando todas as tabelas que não tem PK no SQL SERVER!

SELECT Schema_name(schema_id) AS TableSchema,
       name                   AS TableName
FROM   sys.tables
WHERE  Objectproperty(object_id, 'TableHasPrimaryKey') = 0
ORDER  BY tableschema,
          tablename;


Check out my new book on MariaDB http://www.amazon.com/dp/B00MQC06HC

Nenhum comentário:

Postar um comentário

Leave your comment here!