Click to Rate and Give Feedback
TechNet
TechNet Library
SQL Server
SQL Server 2008
Replication
Technical Reference
 sp_removedbreplication (Transact-SQ...

  Switch on low bandwidth view
Community Content
In this section
Statistics Annotations (0)
Other versions are also available for the following:
SQL Server 2008 Books Online (June 2009)
sp_removedbreplication (Transact-SQL)

This stored procedure is executed at the Publisher on the publication database or at the Subscriber on the subscription database. The procedure removes all replication objects from the database in which it is executed, but it does not remove objects from other databases, such as the distribution database.

ms188734.note(en-us,SQL.100).gifNote:
This procedure should be used only if other methods of removing replication objects have failed. For more information about these methods, see Removing Replication.

Topic link icon Transact-SQL Syntax Conventions

sp_removedbreplication [ [ @dbname = ] 'dbname' ]
    [ , [ @type = ] type ] 
[ @dbname=] 'dbname'

Is the name of the database. dbname is sysname, with a default value of NULL. When NULL, the current database will be used.

[ @type = ] type

Is the type of replication for which database objects are being removed. type is nvarchar(5) and can be one of the following values.

tran

Removes transactional replication publishing objects.

merge

Removes merge replication publishing objects.

both (default)

Removes all replication publishing objects.

0 (success) or 1 (failure)

sp_removedbreplication is used in all types of replication.

sp_removedbreplication is useful when restoring a replicated database that has no replication objects needing to be restored.

sp_removedbreplication cannot be used against a database that is marked as read-only.

-- Remove replication objects from the subscription database on MYSUB.
DECLARE @subscriptionDB AS sysname
SET @subscriptionDB = N'AdventureWorksReplica'

-- Remove replication objects from a subscription database (if necessary).
USE master
EXEC sp_removedbreplication @subscriptionDB
GO

Only members of the sysadmin fixed server role can execute sp_removedbreplication.

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker