Quantcast
Channel: StackExchange Replication Questions
Viewing all articles
Browse latest Browse all 17268

Where should the SQL Server Replication pre-snapshot script go?

$
0
0

I'm looking into using a pre-snapshot script to prevent the snapshot from being applied if certain conditions exist on the subscriber. I've tested this and it works well, but I have a few questions that I couldn't find answers for in the documentation (starting with this: https://msdn.microsoft.com/en-us/library/ms152525.aspx).

  1. My application has to write out this script to the file system during installation. Where should this pre-snapshot script be saved to? The snapshot folder? A hardcoded location like C:\PreSnapshotScripts\?

  2. What is the best way to send an error up to the Snapshot Agent? Currently I'm using RAISERROR, and the error is showing up in Replication Monitor (which is seems to be showing records from [distribution].[dbo].[MSdistribution_history]). However, the error shows up like this "Last 85 characters in 'sqlcmd' output buffer: Msg 50000, Level 11, State 1, Server MyServer\MyInstance, Line 9 Why hello there StackOverflow". Is there a way to just show a line that says "Why hello there StackOverflow"? If not, that's fine. I expect this to be a rare condition, and the customer will probably contact me about it no matter what it says!

Thanks


Viewing all articles
Browse latest Browse all 17268

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>