We know that Primary Key is a must for setting up articles in Transactional Replication.
This query list those tables which do not have Primary Key in that database.
This query list those tables which do not have Primary Key in that database.
USE <DatabaseName> GO SELECT SCHEMA_NAME(schema_id) AS [Schema Name], name AS [Table Name] FROM sys.tables WHERE OBJECTPROPERTY(OBJECT_ID,'TableHasPrimaryKey') = 0 Order by name GO
No comments:
Post a Comment