added files from swmgmt03
This commit is contained in:
34
bag mi drop publication.sql
Normal file
34
bag mi drop publication.sql
Normal file
@@ -0,0 +1,34 @@
|
||||
SELECT TOP (1000)*
|
||||
FROM [msdb].[dbo].MSdistpublishers
|
||||
|
||||
SELECT TOP (1000)*
|
||||
FROM [msdb].[dbo].MSdistributiondbs
|
||||
|
||||
SELECT TOP (1000)*
|
||||
FROM [msdb].[dbo].MSdistributor
|
||||
|
||||
return
|
||||
|
||||
|
||||
-- Disable publishing and distribution.
|
||||
DECLARE @distributionDB AS sysname;
|
||||
DECLARE @publisher AS sysname;
|
||||
DECLARE @publicationDB as sysname;
|
||||
SET @distributionDB = N'distribution';
|
||||
SET @publisher = @@SERVERNAME;
|
||||
SET @publicationDB = N'sl2007';
|
||||
|
||||
-- Disable the publication database.
|
||||
USE SL2007
|
||||
EXEC sp_removedbreplication @publicationDB;
|
||||
|
||||
-- Remove the registration of the local Publisher at the Distributor.
|
||||
USE master
|
||||
EXEC sp_dropdistpublisher @publisher;
|
||||
|
||||
-- Delete the distribution database.
|
||||
EXEC sp_dropdistributiondb @distributionDB;
|
||||
|
||||
-- Remove the local server as a Distributor.
|
||||
EXEC sp_dropdistributor;
|
||||
GO
|
||||
Reference in New Issue
Block a user