2017-3-10 SQL Server Database T--sql statement

Source: Internet
Author: User

Creating a database: Create datebase database name Note: The database name cannot be Chinese, cannot start with a number, and cannot begin with a symbol.

Delete database:drop datebase database name

Creating table:create TABLE table name

(Column name data type,

......

Set Primary key column: Primary key

Set unique columns: Unique

Set non-null: NOT NULL

Set self-increment column: Identity (1) count, 1 per increment

Delete tables:drop table Table name

Add column:ALTER TABLE name add column name data type

Delete column:ALTER TABLE table name drop column name

Add Data:insert into table name values (' s002 ', ' 1987-2-3 ', ' true ', 96)

Modify data:Update table name set column name = value

Delete data:Delete from table name/truncate table table name

Query data:SELECT * FROM table name

2017-3-10 SQL Server database T--sql statement

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.