SQL Server 2008 Operational Data Sheet

Source: Internet
Author: User

SQL Server tables

type of table:① Temporary table

Temporary tables can be used to process intermediate data or to use temporary tables

Share the work in progress with other connections. Temporary tables only

Can be placed in tempdb.

Private Temp Table (#)Global Temp Table (# #) ② system table

Used to store all database objects, data types, constraints,

A table of information related to configuration options.

The data type of the property

1. Basic Data type:① exact numeric type② Approximate number types③unicode Character Types④ binary Type⑤ Date and Time type⑥ String Typeother2. User-defined data types:① The name of the data typesystem built-in data types based on ②whether the ③ is allowed to be emptyyou can use system stored procedures to manage your custom data types

sp_addtype [@typename =] type,

[@phystype =] System_data_type

[], [@nulltype =] ' null_type '

For example: sp_addtype phone1, 'char (one)','notnull'  

to delete a custom data type by using a system stored procedure

For example: Sp_droptype phone1  

Create a data table

1. Create with Sqlsms2. Using SQL statements to create

CREATE TABLE Tabel_name

(Colomn_name data_type

[Identity [(Seed,increment)]

[<colunm_constraint>]])

For example:

1 Create TableSC (2SnoChar(5),3CnoChar(3),4Gradeint Check(Grade>=0  andGrade<= -),5     Primary Key(SNO,CNO)6)

Modify Table

1. Modify the table name① renaming with Sqlsms② using system stored procedures

sp_rename [@objname =] ' object_name ', [@newname =] ' new_name '

For example : sp_rename 'sc',' elective course '

2. Modifying the properties of a table3. Attribute Columns① modifying, adding, and deleting columns in the Table Designer  ② use T-SQL statements to modify and delete columns, such as

alter table elective add grade1 int

alter table elective drop column grade1

Delete a table

1. Delete with sqlsms 2. Delete using SQL statement

Example: drop table Elective course

SQL Server 2008 Operational Data Sheet

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.