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.