Share via


Step 2: Generating the Pre-Snapshot.sql Script

The Pre-Snapshot.sql script configures the production database with the required catalog schema elements so that it will be ready to receive replication of data.

After running the Create Publication Wizard, you must generate a custom script, and then modify the script to establish the proper destination environment for the subscriber servers in production.

In this step, you will generate a script named Pre-Snapshot.sql to create the views, stored procedures, user defined functions, tables, and free-text indexes on the production server.

To generate the Pre-Snapshot.sql script

  1. In SQL Enterprise Manager, right click the staging database node, point to All Tasks, and then click Generate SQL Script.

  2. In the Generate SQL Script dialog box, click Show All to show all objects available for replication.

  3. Select Script all objects to have all the catalog objects scripted.

  4. In the Generate Scripts dialog box, on the Options tab, in the Table Scripting Options section, select Script indexes, Script full-text indexes, and Script PRIMARY keys, FOREIGN keys, defaults, and check constrains.

  5. In the File Options section, select International text (Unicode).

  6. In the Files to Generate section, select Create one file, and then click OK.

  7. Save the file to the following path and file name:

    C:\Program files\Microsoft SQL Server\MSSQL\Install\Pre-Snapshot.sql

The script is generated and saved as Pre-Snapshot.sql.

Proceed to the next step, Step 3: Modifying the Pre-Snapshot.sql Script.

Copyright © 2005 Microsoft Corporation.
All rights reserved.