4 out of 7 rated this helpful - Rate this topic

Database Design (Management Portal for SQL Database)

The Database Design workspace enables you to work with tables, views, and stored procedures in Windows Azure SQL Database, and to create, modify, save, and run Transact-SQL queries.

To manage databases and data-tier applications, you must have a Windows Azure subscription and a SQL Database server. For more information about how to get started with Windows Azure and SQL Database, see the Windows Azure Platform Management Portal.

You must be a member of the dbmanager role or assigned CREATE DATABASE permissions to create a database, including creating a database by deploying a DAC package. You must be a member of the dbmanager role, or have been assigned DROP DATABASE permissions to drop a database.

For steps to launch the management portal, login to the service, and connect to a SQL Database, see Get Started with the Management Portal for SQL Database.

Use the Database Design workspace to perform these tasks:

The management portal supports Transact-SQL queries. This section describes how to use the management portal to create, modify, save, and run a Transact-SQL query.

For more information about working with queries in SQL Database, see Transact-SQL Reference (Windows Azure SQL Database).

  1. To create a new query, click New Query in the database ribbon. This will launch the query ribbon and the Query Editor. You will see the name of the database above the query window. To connect the Query Editor to a different database, click on the name of the currently selected database in the upper left-hand corner. Select the database to connect to by clicking on the database name, or by finding it in the list, or by searching for it in the Search box.

  2. To run the statement, click Run. To run only a section of the statement, highlight the syntax to run, and then click Run. The Query Editor will return the results and any related messages.

  3. To save a query as a file, click Save to open the save dialog, specify the name and location for the file, and then click Save.

  4. To open an existing query, click Open on the ribbon, browse to the location where the file is saved, and double-click the file to open it, or click on the file to select it, and then click Open. Once a query is open, you can modify its syntax, or you can run it by clicking Run.

  5. Once you have query results displayed, notice that the Actual Plan and Estimate… buttons are enabled, allowing you to run estimated query plans or actual query plans for the selected Transact-SQL syntax. You can view query plans in a graphical display, in a grid view, or a tree view. Change the display type by clicking the toggle buttons at the upper right-hand side of the Query Plan details pane.

Database Design Tasks

This section describes how to use the management portal to create or modify a table in an existing database.

For more information about database tables, see Tables in SQL Server Books Online.

  1. To enable the table design surface, connect to an existing database and then click Design in the left-hand navigation pane. To connect to a different database, use the database selection drop-down menu to select the database to connect to, and then click Design in the lower-left navigation area . Easily switch between Tables, Views, and Stored Procedures by clicking on the labels at the top of the page. Search for an existing table by typing in the Search field above the list of tables. To see database properties for the database you are connected to, click Summary in the left-hand navigation pane.

  2. To create a new table, click New Table at the bottom of the list of tables. This will launch the Table Designer workspace. Note the database and table names above the design surface.

  3. Specify a name for the table in the Table Name field in the Table Designer. Note that each row in the Table Designer defines a column in the new table.

  4. For each column in the table, specify a name in the Column field by double-clicking the column name cell, and specify a supported data type under Select type. Also specify a default value, and select check boxes to specify if the column is an identity column, a required column, or a primary key for the database table.

    To add an additional column to the table, click Add Column at the bottom of the list of columns, or click Add Column in the Table Designer.

  5. To delete one or more columns from the table, click on the row or rows to delete in Table Designer, and then click Delete Column at the bottom of the list of columns.

  6. When you finish designing the table and are ready to create it, click Save in the ribbon.

  7. To modify an existing table, click Tables in the breadcrumb trail, click the table name to select it, and then click Edit on the right-hand side of the row for that table. Note the database and table names above the workspace in the breadcrumb trail. With Table Designer, you can modify the table design by editing column definitions, adding new columns, or dropping existing columns.

  8. After modifying a table, click Save. You must save changes before you toggle between table design and table data functionalities.

  9. To edit data in an existing table, click Tables in the breadcrumb trail, click the table name to select it, and then click Data on the right-hand side of the row for that table, or select the table to modify, and then click Data in the Edit ribbon. This will launch the Data Editor workspace. Note the database and table names above the workspace.

  10. Use the Data Editor workspace to modify cell values of existing rows, insert or delete a row using the Add Row and Delete Row buttons in the ribbon. You can also add a row by clicking Add Row at the bottom of the Data Editor workspace.

  11. When you finish, click Save. You must save changes before you toggle between table design and table data functionalities.

Database Design Tasks

Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.