Manipulating data tables with T-SQL statements-inserting data

Source: Internet
Author: User
Insert the data (insert) syntax:
Insert [into] < table name > [column Name] Values < value list >
Explain:
Insert: Is the syntax name, inserted meaning
Into: optional, can be omitted.
Table names are required and which tables need to be added to. If the table name is Chinese, expand it in English brackets
Column names can be omitted, but subsequent values in the list are in the same order as the fields in the data table
Multiple column names and multiple value lists separated by commas (comma in English)
Example:
insert into [information table] (name, XXX number, home address, ~) VALUES (' Zhang San ', ' 123213213213 ', ' Home address ', ~)
Precautions:
1. Insert a whole row of data, not just half a row or columns of data.
2. The number of data values must be the same as the number of columns, and each data-worthy type, precision, and scale must also match the corresponding column.
The 3.insert statement cannot specify a value for an identifier column because its value is automatically increased.
4. For columns of character types, single quotes are required when inserting data.
5. If you specify that a column is not allowed to be empty when you design the table, the column must insert data, otherwise an error message will be reported.
6. Inserting data items requires compliance with the check constraint.
7. Although you may not specify a column name, you should develop a good habit of explicitly specifying the inserted columns and corresponding values.

Manipulating data tables with T-SQL statements-inserting data

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.