Ads

06 August 2013

Script to Enable/Disable Database for Replication

Script to Enable/Disable Database for Replication


You can enable the database for replication using below script.
1
2
3
4
5
use master
exec sp_replicationdboption @dbname = 'sqldbpool',
@optname = 'publish',
@value = 'true'
go
If you have restore the database on test environment and you are getting the error that “Database is part of Replication”, you can clear/disable it by executing below query.
1
2
3
4
5
use master
exec sp_replicationdboption @dbname = 'sqldbpool',
@optname = 'publish',
@value = 'false'
go

No comments:

Post a Comment