SansSQL: Transactional Replication

Monday, October 28, 2013

SQL Server Replication - Configuring Publisher - Transactional Replication

In one my previous post "SQL Server Replication - Configuring Distributor", we have seen how to configure the distributor database. In this post, we will see how to configure the publisher for transactional replication.
  • Expand the SQL Server Instance and then "Replication"
  • Right Click on "Local Publications" and choose "New Publication"
  • Click Next in the welcome screen

Tuesday, September 25, 2012

T-SQL Query to find List of Tables that do not have Primary Key

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.

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

Ads