Database Reference
In-Depth Information
Figure 4.9
Column deinitions.
4.4 Managing Database Objects
After the tables have been created, the table structures can be viewed and modiied with SQL
statements or the built-in stored procedures.
4.4.1 Viewing Table Structures
To view the table properties, you can use the following stored procedures and commands provided
by Windows Azure SQL Database:
sp_help: a built-in stored procedure used to view table deinitions
sp_depends: a built-in stored procedure used to view table dependencies
When running the stored procedure sp_help to view the table deinition for the table
PRODUCT, you should be able to see the detailed table deinition as shown in Figure 4.10.
4.4.2 Modifying Table Structures
SQL statements can be used to modify the structure of database objects. You can change the data
type of a column, rename a column or a table, modify constraints, add new columns, or assign
permissions to schemas.
he ALTER TABLE statement is used to change the table structure. For example, if you want
to add a foreign key constraint to the column EmployeeID in the table SHIPPING, you can use
the following SQL statement:
Search WWH ::




Custom Search