Professional Documents
Culture Documents
TCS Internal 1
Objective
TCS Internal 2
Scope
TCS Internal 3
Creating Database Objects
TCS Internal 4
Creating Database (T-SQL)
Using Transact-SQL, database can be created using the CREATE DATABASE statement.
Example:
TCS Internal 5
Creating Table (T-SQL)
Using Transact-SQL, table can be created using the CREATE TABLE statement.
Example:
TCS Internal 6
Creating other database objects
TCS Internal 7
Modifying Database Objects
Transact-SQL
SQL Server Management Studio
SQL Server supports changing the structure of the following database objects.
Database
Table
Schema
Stored Procedure
View
Trigger
TCS Internal 8
Altering a Database
Example:
TCS Internal 9
Altering a Table
Example:
TCS Internal 10
Removing Database Objects
All Transact –SQL statements to remove a database object have a general form:
Default
RULE
TYPE
PROCEDURE
INDEX
VIEW
TRIGGER
SCHEMA
STATISTICS
TCS Internal 11
Summary
SQL Server supports many data definition statements that create, alter, and remove
database objects. The following database objects, among others, can be created and
removed using the CREATE object and the DROP object statement, respectively:
Database
Table
Schema
View
Trigger
Stored Procedure
Index
Rule
Default
TCS Internal 12