5. Click Next twice and the wizard generates the SQL script for you in your Documents folder (as
specified in the File Name box shown in Figure 19-16). Open the file in Notepad and look at the
SQL statements it contains. Although most of it probably looks like gibberish to you, it can be used
as is to re-create the database structure and data on a compatible SQL Server database.
How It Works
The contents of a database can be separated in two categories: the structure of the database and the
actual data. When the scripting tool runs, it investigates the structure of your database first and creates
SQL CREATE statements for all the items it finds in your database, such as the tables you created in earlier
chapters. It then creates INSERT statements that re-create all records such as Reviews, Genres, and even
users in the target database. By clearing the Script All Objects check box at the beginning of the wizard,
you can selectively choose parts of your database, enabling you to script only a few tables, for example.
At the end, the scripting tool assembles all the SQL statements and saves them to a single .sql file. This
fi le is now ready to be run at your host to re-create the database.