Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Replication Script Out. Expand / Collapse
Author
Message
Posted Wednesday, October 10, 2012 3:40 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Monday, June 16, 2014 10:44 AM
Points: 153, Visits: 583
Need Help!

We have whole lot of replication.

Can we have a automatic process to generate script for all Publication on the local server and save it on local drive as txt or sql file as backup everyday.
Post #1371145
Posted Thursday, October 11, 2012 3:31 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Monday, June 16, 2014 10:44 AM
Points: 153, Visits: 583
Any Help ...!
Post #1371802
Posted Saturday, October 13, 2012 5:46 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Monday, August 18, 2014 3:04 AM
Points: 1,362, Visits: 15,269
I use a combination of PowerShell and SQL PSX


$Instance = 'ServerName'

$scriptargs = [Microsoft.SqlServer.Replication.scriptoptions]::Creation `
-bor [Microsoft.SqlServer.Replication.scriptoptions]::IncludeArticles `
-bor [Microsoft.SqlServer.Replication.scriptoptions]::IncludeGO`
-bor [Microsoft.SqlServer.Replication.scriptoptions]::IncludeCreateSnapshotAgent`

Get-ReplPublication $Instance | ForEach-Object {
$script = Get-ReplScript $_ -scriptOpts $scriptargs
$script | out-file -filepath $FilePath -force; }


Post #1372414
Posted Monday, October 15, 2012 9:47 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Monday, June 16, 2014 10:44 AM
Points: 153, Visits: 583
How to use the script to run. Can we schedule with an agent job.

Thanks for your replay,
Post #1372788
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse