Venkatesh R
Venkatesh R

Reputation: 514

sp_dboption in SQL server 2012 for Published property

Currently working on migrating SQL server from 2008 to 2012 project. We aware that sp_dboption is deprecated and it will not work in SQL server 2012. In 2008, had code to set the value for Published property.

EXEC master..sp_dboption DBName, published, TRUE

In 2012, below query is not working. I think i am using incorrect property name 'PUBLISHED'.

ALTER DATABASE DBName SET PUBLISHED ON

Please help me on the same.

Upvotes: 0

Views: 756

Answers (1)

sepupic
sepupic

Reputation: 8687

To modify database options that are associated with replication (merge publish, published, subscribed), use sp_replicationdboption.

sp_replicationdboption (Transact-SQL)

exec sp_replicationdboption @dbname = 'DBName',
@optname = 'publish',
@value = 'true'

Upvotes: 1

Related Questions