Search This Blog

Tables without Primary Keys

this script will be useful when you are configuring the trans. replication


SELECT *
FROM information_schema.tables
WHERE table_type = 'base table'
AND OBJECTPROPERTY(OBJECT_ID(table_name), 'IsMsShipped') = 0
AND OBJECTPROPERTY(OBJECT_ID(table_name), 'TableHasPrimaryKey') = 0
ORDER BY Table_Name

No comments: