replication - post snapshot script

  • hello,

    is it somehow possible to pass a variable like a database name into a post snapshot script.

    i would need to pass a database name into the post snapshot script when creating the replication with sqlcmd.

    where the create publication looks like this:

    exec sp_addpublication @publication = ... ,@post_snapshot_script = N'$(SnapshotScriptPath)\PostSnapshot.sql',...

    and i would need to somehow pass the dbname as a variable in the postsnapshot script.

    in the postsnapshot.sql i would then need to set:

    use [$(dbname)]

    thanks,

    Chris

  • Only way I can think of to do this would be to use Powershell. But I have never done it before. So I cant give you any samples.

    -Roy

Viewing 2 posts - 1 through 1 (of 1 total)

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