How to: Generate a Snapshot for a Merge Publication with Parameterized Filters (SQL Server Management Studio)
Generate snapshots for partitions on the Data Partitions page of the Publication Properties - <Publication> dialog box. For more information about accessing this dialog box, see How to: View and Modify Publication and Article Properties (SQL Server Management Studio). You can allow Subscribers to initiate snapshot generation and delivery and/or generate snapshots.
Note
If the filtering for one or more articles in the publication yields non-overlapping partitions that are unique for each subscription, metadata is cleaned up whenever the Merge Agent runs. This means that the partitioned snapshot expires more quickly. When using this option, you should consider allowing Subscribers to initiate snapshot generation and delivery. For more information about filtering options, see the "Setting 'partition options'" section of Snapshots for Merge Publications with Parameterized Filters.
Before generating snapshots for one or more partitions, you must:
- Create a merge publication with the New Publication Wizard, and specify one or more parameterized row filters on the Add Filter page of the wizard. For more information, see How to: Define and Modify a Parameterized Row Filter for a Merge Article (SQL Server Management Studio).
- Generate a schema snapshot for the publication. By default, a schema snapshot is generated when you complete the New Publication Wizard; you can also generate a schema snapshot from Microsoft SQL Server Management Studio.
To generate a schema snapshot
Connect to the Publisher in Management Studio, and then expand the server node.
Expand the Replication folder, and then expand the Publications folder.
Right-click the publication for which you want to create a snapshot, and then click View Snapshot Agent Status.
In the View Snapshot Agent Status - <Publication> dialog box, click Start.
When the Snapshot Agent finishes generating the snapshot, a message will be displayed, such as "[100%] A snapshot of 17 article(s) was generated."
To allow Subscribers to initiate snapshot generation and delivery
On the Data Partitions page of the Publication Properties - <Publication> dialog box, select Automatically define a partition and generate a snapshot if needed when a new Subscriber tries to synchronize.
Click OK.
To generate and refresh snapshots
On the Data Partitions page of the Publication Properties - <Publication> dialog box, click Add.
Enter a value for the HOST_NAME() and/or SUSER_SNAME() value associated with the partition for which you want to create a snapshot.
Optionally specify a schedule for refreshing snapshots:
- Select Schedule the Snapshot Agent for this partition to run at the following time(s)
- Accept the default schedule for refreshing snapshots, or click Change to specify a different schedule.
Click OK, which returns you to the Publication Properties - <Publication> dialog box.
Select the partition in the property grid, and then click Generate the selected snapshots now.
Click OK.
See Also
Concepts
Parameterized Row Filters
Snapshots for Merge Publications with Parameterized Filters