sql/ replication/ merge-replication

I have a stored procedure that takes a "DBname" parameter and creates a new database from a backup, naming the new database with the parameter. So if i execute the sproc with param = 'myDB1" it creates a new database from an existing backup and names it myDB1.

As databases are created I manually set up Merge Replication for each one. The publication configurations are basically the same, just one for each database. I have custom snapshot folder, specific account for Agent Security, and some accounts added into the PAL.

Is there a way to automate the Publication setup? Can I add some sql to the database generation sproc that will create a Publication for the new database at the time of creation? And have all the settings set correctly?

Figured it out - In the Publication list, right click a publication that you'd like to clone and use the Generate Script option. Script to query window and then change some of the static inputs to SQL paramaters. I created as a stored procedure in the backed up database. Now when a new database is generated from that backup, I run the SP in the new database and replication is generated for me.

暂无
暂无

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

Related Question SQL Server merge replication permissions issue Complex filter for SQL Server Merge Replication SQL Server Merge - Pull replication error SQL Server Compact merge replication with NT Authentication Merge replication between sql server 2008 and 2000 SQL Server Merge Replication - Is “Upload Only” Possible? Merge Replication and the Performance Impact on the controller SQL server SQL Replication : Is there a way to take the same effect of Snapshot Replication by using Merge Replication? Errors restoring a Sql Server 2008 database with Merge Replication Maximum subscriber nodes that can be configured in SQL Server 2012 Merge Replication
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM