|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Wednesday, May 29, 2013 9:26 AM
Points: 138,
Visits: 511
|
|
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.
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Wednesday, May 29, 2013 9:26 AM
Points: 138,
Visits: 511
|
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: 2 days ago @ 2:25 AM
Points: 1,125,
Visits: 14,518
|
|
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; }
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Wednesday, May 29, 2013 9:26 AM
Points: 138,
Visits: 511
|
|
How to use the script to run. Can we schedule with an agent job.
Thanks for your replay,
|
|
|
|