Migrating Databases to SQL Azure by Generating a Script of an Existing Database Using the Generate Scripts Wizard in SQL Server 2008 R2
Create the Transact-SQL Script
- In Object Explorer, right-click the database, point to Tasks, and select Generate Scripts.
- In the Generate and Publish Scripts Wizard dialog box, click Next to get to the Choose Objects step. Select Script entire database and all database objects, and then click Next.
- In Set Scripting Options, set the following options:
- Set Output Type as Save script to a specific location. Select Save to file. Click Single file. Type the file name and location in File name. Click Advanced.
- In Advanced Scripting Options set “Script for the database engine type” option as “SQL Azure Database”, set “Convert UDDTs to Base Types” option as “True”, and set “Types of data to script” option as “Schema and data”. Click OK.
- Click Next, click Next, and then click Finish.
SQL Server 2008 R2