The difference between MySQL and SQL Server in inserting data

Source: Internet
Author: User
Tags command line

Environment: MySQL Sever 5.1 + SQL Server 2008 R2

Problem: The difference between MySQL and SQL Server in inserting data

First look at two pictures:

Mysql:

Sql server:

Create a table in MySQL, the primary key is growing, when inserting data, do not specify column names (for each field is assigned), the number of columns does not match, the column name after the specified normal inserted, and in SQL Server, the table's primary key is also an increase, do not specify a column name but can be inserted normally.

Attached SQL:

Mysql

CREATE TABLE Tb_user (ID int primary KEY auto_increment,name varchar

() not null,password varchar () not NULL);

Sql server

CREATE TABLE Tb_user (ID 

int PRIMARY key identity,name varchar () not null,password varchar () is not null);

Summary: When inserting data using the command line, if you assign a value to each field, you specify the column name in MySQL, not in SQL Server. See the different database for SQL support different, usually pay more attention to these differences, and pay attention to summary. Also remind everyone, use the database, try not to use a graphical interface, use more, really will make you stupid, and the control of the SQL does not help. It is recommended that you use the command line to manipulate the database.

See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/database/MySQL/

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.