You can enable the database for replication using below script.
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.
use master exec sp_replicationdboption @dbname = 'sqldbpool', @optname = 'publish', @value = 'false' go
while i execute the above enable command , i am getting thebelow error
OLE DB provider “SQLNCLI11” for linked server “repl_distributor” returned message “Login timeout expired”.
OLE DB provider “SQLNCLI11” for linked server “repl_distributor” returned message “A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.”.
Msg 53, Level 16, State 1, Line 0
Named Pipes Provider: Could not open a connection to SQL Server [53].
pls help on this issue
what is the issue? Can you give me more information?
Jugal
is there any possible way to enable and disable publication articles via PS and or SQL script without dropping publication. When I run the above it actually drops pub and renders in inaccessible.