Previous Topic

Next Topic

Inhoudsopgave

Book Index

Using SQL Server Management Studio

If you use SQL Server Management Studio, you must run the scripts in the listed order:

  1. 1_Create_ANSI_Migration_database.sql

    This script creates the ANSI_Migration database.

  2. 2_Create_sp_ip_sel_ObjectInfo.sql

    This script creates a system stored procedure.

  3. 3_Migrate_ANSI_NULLS_tables.sql

    Script 3, the script that generates and executes the migration statements, will bring the database into single-user mode, so you must wait until this script has finished until you can query the database. Script 3 will create a new migration run in the ANSI_Migration database with the remark given in the Remark variable.

  4. 4_Report_on_ANSI_NULLS_migration.sql

    Script 4 will retrieve the migration reports from ANSI_Migration database. Because script 3 creates the run, script 4 does not know the value of the run_id field. Script 4 will retrieve the information for the last run with the database name and run remark given in the :setvar commands. Make sure to use the same values for these variables as in script 3, otherwise you will not report on the correct migration run. At the bottom of the script, examples of a statement are displayed that selects all the statements generated for a table. You can experiment and/or create extra reports. However, do not remove the existing reports.

You only have to run script 1 and 2 once on a server where you perform migrations. However, there is no harm in running these multiple times: the database ANSI_Migration will not be dropped, so data of previous runs will be saved.

Script 3 and 4 contain instructions in the header on how to use them from SSMS. You must run SSMS in SQLCMD Mode. From the menu, choose Query, SQLCMD Mode to enable this mode. In addition, uncomment the :setvar commands and type the database name and migration remark instead of the example values.