MSDN Documentation

SQL Server – Data Definition

SQL Data Definition – Objects

This section provides an overview of the primary database objects that can be defined using SQL Data Definition Language (DDL) statements.

On this page

Tables

Tables store data in rows and columns. They are defined with CREATE TABLE and can include constraints such as primary keys, foreign keys, defaults, and checks.

DDL StatementDescription
CREATE TABLECreates a new table.
ALTER TABLEAdds, modifies, or drops columns and constraints.
DROP TABLERemoves a table and its data.

Views

Views are virtual tables defined by a query. They simplify complex queries and can provide security by restricting column access.

DDL StatementDescription
CREATE VIEWDefines a new view.
ALTER VIEWModifies an existing view definition.
DROP VIEWDeletes a view.

Indexes

Indexes improve query performance by providing fast access paths to rows. They can be clustered, non‑clustered, unique, or filtered.

DDL StatementDescription
CREATE INDEXCreates a new index.
CREATE UNIQUE INDEXCreates a unique index.
DROP INDEXRemoves an index.

Stored Procedures

Stored procedures encapsulate reusable T‑SQL logic. They can accept parameters, return result sets, and manage transactions.

DDL StatementDescription
CREATE PROCEDURECreates a new stored procedure.
ALTER PROCEDUREModifies an existing procedure.
DROP PROCEDUREDeletes a procedure.

Functions

Functions return a scalar value or a table. They are deterministic and can be used in queries, constraints, and computed columns.

DDL StatementDescription
CREATE FUNCTIONCreates a new scalar or table‑valued function.
ALTER FUNCTIONModifies an existing function.
DROP FUNCTIONDeletes a function.

For detailed syntax and examples, refer to the individual object pages linked in the left navigation.