Thursday, January 17, 2013

How to Disable Publishing and Distribution Using T-SQL In SQL Server

How to Disable Publishing and Distribution using Transact SQL?

Find below script for disabling the publishing and distribution using transact SQL query. 

-- Disable publishing and distribution.

DECLARE @distributionDB AS sysname;
DECLARE @publisher AS sysname;
DECLARE @publicationDB as sysname;
SET @distributionDB = N'distribution';
SET @publisher = N'server_name';
SET @publicationDB = N'database_name';

-- For disabling the publication database.
USE [database_name]
EXEC sp_removedbreplication @publicationDB;

-- For removing the registration of the local Publisher at the Distributor.
USE master
EXEC sp_dropdistpublisher @publisher;

-- For deleting the distribution database.
EXEC sp_dropdistributiondb @distributionDB;

-- For removing the local server as a Distributor.
EXEC sp_dropdistributor;
GO
How to Disable Publishing And Distribution. Manually removed sysdatabase distribution. cannot disable Distribution/Publishing on server. Unable to disable publishing and distribution. disable publishing and distribution error. disable publishing and distribution wizard. how to disable publishing and distribution transact sql. disabling distribution and publishing in SQL Server 2008 where the process hangs. How to Disable Publishing And Distribution in sql server 2012. How to Disable Publishing And Distribution in sql server 2005. steps to remove orphaned replication objects.

0 comments:

Post a Comment