Replication Script Out.

  • 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.

  • Any Help ...!

  • 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; }

  • How to use the script to run. Can we schedule with an agent job.

    Thanks for your replay,

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply