CREATE command is used for creating any object on the database server.
Syntax:
CREATE Table<Table_name>(<columnlist1><datatype>[width],…<columnlistn><datatype>[width])
Rules for CREATE command:
- Name of the table should always be unique under the database
- A table name should not start with numeric’s or special characters
- The maximum acceptable size for an object is 128 characters
- Column name should be unique under the tables
- A table can have maximum 1024 columns
Example:
CREATE table Bank (Custid int, Custname varchar (50), Bal Decimal (7, 2))
Note: SP_Help < Table_name> command is used to view the structure of a table under database
Example: SP_Help Bank
No comments:
Post a Comment