816
Part V: Enterprise Data Management
CONSTRAINT [PK_Contact_ContactID] PRIMARY KEY CLUSTERED
(
[ContactID] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF)
)
GO
Now that you’ve made the necessary corrections, you’re ready to create your objects in a
SQL database.
Executing a Script Against an Azure SQL Database Instance
In this section you will use the database you created at the beginning of this chapter
called AWMini. The following steps will walk you through executing the recently generated
script from the Generate Scripts wizard against that database.
- The query window from the results from the Generate Scripts wizard is currently
connected to your local SQL instance, so you need to change it to your SQL Azure
Database instance and the database you just created. Right-click anywhere in the
script, and select Connection Change Connection from the context menu. - In the Connect to Database Engine dialog, enter the information for your SQL Azure
Database instance, and enter the name of the database you created earlier on the
Connection Properties tab. - Click Connect.
You now have your script and a connection to your SQL Azure database instance. Click the
Execute button. Your script should run and create the tables, procedures, and data in your
SQL Azure Database instance.
The SQL Server Generate and Publish Script Wizard is a great way to start understanding the
required changes that you need to make when migrating to SQL Database. With this founda-
tion, consider one of the other options, SQL Server Integration Services.
SQL Server Integration Services
SQL Server Integration Services (SSIS) is a data-integration and workfl ow-solutions plat-
form, providing Extract, Transformation, Load (ETL) solutions for data warehousing, as
well as extractions and transformations. With its graphical tools and wizards, developers
often fi nd that SSIS is a quick solution for moving data between a source and destina-
tion. As such, it’s a great choice for migrating data between a local database and a SQL
Azure database instance. Notice, however, that the previous sentence says data. When
you use SSIS, the database and tables must already exist in SQL Database. If you’re famil-
iar at any level with SSIS, you’re probably wondering why it has the limitation of moving
only data. Several SSIS tasks can provide the functionality of moving objects as well as
data, such as the Transfer SQL Server Objects task. When asked about this task, Microsoft
c31.indd 816c31.indd 816 7/31/2012 10:00:26 AM7/31/2012 10:00:26 AM
http://www.it-ebooks.info