Home Database Mysql Tutorial sql server跟my sql 命令(语句)的区别,sql server与mysql的比

sql server跟my sql 命令(语句)的区别,sql server与mysql的比

Jun 07, 2016 pm 04:26 PM
mysql s server sql the difference Order statement

sql server和my sql 命令(语句)的区别,sql server与mysql的比较 sql与mysql的比较 1、连接字符串 sql :Initial Catalog(database)=x; --数据库名称 Data Source(source)=x; --服务器 Persist Security Info=True; --集成sql server身份验证 Integrated Sec

sql server和my sql 命令(语句)的区别,sql server与mysql的比较
sql与mysql的比较

1、连接字符串
sql  :Initial Catalog(database)=x;  --数据库名称
      Data Source(source)=x;        --服务器
      Persist Security Info=True;   --集成sql server身份验证
      Integrated Security=True      --集成windows身份验证
      User ID(uid)=x;               --用户名
      Password(pwb)=x;              --密码

mysql:Database=x;                   --数据库名称
      Data Source=x;                --服务器
      User Id(uid)=bizhi;           --用户名
      Password=x;                   --密码
      pooling=false;                --
      CharSet=utf8;                 --编码
      port=x                        --端口


2、连接对象
sql  :SqlConnection
mysql:MySqlConnection


3、命令:
sql  :SqlCommand
mysql:MySqlCommand


4、参数
sql  :SqlParameter
mysql:MySqlParameter


5、填充:
sql  :SqlDataAdapter
mysql:MySqlDataAdapter


6、查询所有库
sql  :select * from [master]..[SysDatabases];
mysql:SHOW DATABASES;


7、显示指定库的所有表
sql  :select * from [_DatatBaseName]..[SysObjects] where [type]='U';
mysql:USE _DatatBaseName; SHOW TABLES;


8、显示指定库的指定表的所有字段
sql  :select top 0 * from [_DatatBaseName]..[_TableName];
      select * from [syscolumns] where [ID]=OBJECT_ID('BPM..OrderFollow');
mysql:USE _DatatBaseName; SHOW COLUMNS FROM _TableName;
      USE _DatatBaseName; DESCRIBE _TableName;


9、查询当前时间
sql  :select getdate();
mysql:SELECT NOW();


10、备份数据库
sql  :backup _DatatBaseName to disk='d:\123.bak';
mysql:


11、创建数据库
sql  :use master
      go

      --删除数据库
      if exists(select * from sysdatabases where name='kl')
          drop database [HBDataBase]; --删除
      go

      --创建数据库
      create database [kl]
      on  --主文件
      (
          name='kl',
          size=3mb,
          filename='D:\kl.mdf',
          maxsize=100mb,
          filegrowth=1mb
      )
      log on --日志文件
      (
          name='kl_Log',
          filename='D:\kl.ldf',
          size=1mb,
          maxsize=5mb,
          filegrowth=5%
      )
      go
mysql:CREATE DATABASE _DatatBaseName;


12、分页
sql  :top N
      ROW_NUMBER() over(order by xx desc )
mysql:limit


13、添加的自增列
sql  :insert into xx(bb) output inserted.vv vlaues('');
      select @@identity;
mysql:SELECT @@session.identity;
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

MySQL: An Introduction to the World's Most Popular Database MySQL: An Introduction to the World's Most Popular Database Apr 12, 2025 am 12:18 AM

MySQL is an open source relational database management system, mainly used to store and retrieve data quickly and reliably. Its working principle includes client requests, query resolution, execution of queries and return results. Examples of usage include creating tables, inserting and querying data, and advanced features such as JOIN operations. Common errors involve SQL syntax, data types, and permissions, and optimization suggestions include the use of indexes, optimized queries, and partitioning of tables.

Why Use MySQL? Benefits and Advantages Why Use MySQL? Benefits and Advantages Apr 12, 2025 am 12:17 AM

MySQL is chosen for its performance, reliability, ease of use, and community support. 1.MySQL provides efficient data storage and retrieval functions, supporting multiple data types and advanced query operations. 2. Adopt client-server architecture and multiple storage engines to support transaction and query optimization. 3. Easy to use, supports a variety of operating systems and programming languages. 4. Have strong community support and provide rich resources and solutions.

MySQL's Place: Databases and Programming MySQL's Place: Databases and Programming Apr 13, 2025 am 12:18 AM

MySQL's position in databases and programming is very important. It is an open source relational database management system that is widely used in various application scenarios. 1) MySQL provides efficient data storage, organization and retrieval functions, supporting Web, mobile and enterprise-level systems. 2) It uses a client-server architecture, supports multiple storage engines and index optimization. 3) Basic usages include creating tables and inserting data, and advanced usages involve multi-table JOINs and complex queries. 4) Frequently asked questions such as SQL syntax errors and performance issues can be debugged through the EXPLAIN command and slow query log. 5) Performance optimization methods include rational use of indexes, optimized query and use of caches. Best practices include using transactions and PreparedStatemen

Solution to MySQL encounters 'Access denied for user' problem Solution to MySQL encounters 'Access denied for user' problem Apr 11, 2025 pm 05:36 PM

How to solve the MySQL "Access denied for user" error: 1. Check the user's permission to connect to the database; 2. Reset the password; 3. Allow remote connections; 4. Refresh permissions; 5. Check the database server configuration (bind-address, skip-grant-tables); 6. Check the firewall rules; 7. Restart the MySQL service. Tip: Make changes after backing up the database.

How to connect to the database of apache How to connect to the database of apache Apr 13, 2025 pm 01:03 PM

Apache connects to a database requires the following steps: Install the database driver. Configure the web.xml file to create a connection pool. Create a JDBC data source and specify the connection settings. Use the JDBC API to access the database from Java code, including getting connections, creating statements, binding parameters, executing queries or updates, and processing results.

Centos install mysql Centos install mysql Apr 14, 2025 pm 08:09 PM

Installing MySQL on CentOS involves the following steps: Adding the appropriate MySQL yum source. Execute the yum install mysql-server command to install the MySQL server. Use the mysql_secure_installation command to make security settings, such as setting the root user password. Customize the MySQL configuration file as needed. Tune MySQL parameters and optimize databases for performance.

Difference between centos and ubuntu Difference between centos and ubuntu Apr 14, 2025 pm 09:09 PM

The key differences between CentOS and Ubuntu are: origin (CentOS originates from Red Hat, for enterprises; Ubuntu originates from Debian, for individuals), package management (CentOS uses yum, focusing on stability; Ubuntu uses apt, for high update frequency), support cycle (CentOS provides 10 years of support, Ubuntu provides 5 years of LTS support), community support (CentOS focuses on stability, Ubuntu provides a wide range of tutorials and documents), uses (CentOS is biased towards servers, Ubuntu is suitable for servers and desktops), other differences include installation simplicity (CentOS is thin)

How to install mysql in centos7 How to install mysql in centos7 Apr 14, 2025 pm 08:30 PM

The key to installing MySQL elegantly is to add the official MySQL repository. The specific steps are as follows: Download the MySQL official GPG key to prevent phishing attacks. Add MySQL repository file: rpm -Uvh https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm Update yum repository cache: yum update installation MySQL: yum install mysql-server startup MySQL service: systemctl start mysqld set up booting

See all articles