T-SQL、SQL Server和SQL有什么区别

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1301038/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-01 03:15:51  来源:igfitidea点击:

What are the differences between T-SQL, SQL Server and SQL

sqlsql-servertsql

提问by DenaliHardtail

I know enough about SQL to get my job done but reading different articles I see T-SQL, SQL Server and SQL. Are they all the same? What are the major differences between the three?

我对 SQL 的了解足以完成我的工作,但阅读不同的文章我看到了 T-SQL、SQL Server 和 SQL。他们都一样吗?三者之间的主要区别是什么?

I know SQL is an ANSI standard. What about the other two?

我知道 SQL 是 ANSI 标准。另外两个呢?

回答by user158017

SQL is the basic ANSI standard for accessing data in a relational database. When you see "MSSQL" it is referring to Microsoft SQL Server, which is the entire database architecture and not a language. T-SQL is the proprietary form of SQL used by Microsoft SQL Server. It includes special functions like cast, convert, date(), etc. that are not part of the ANSI standard.

SQL 是用于访问关系数据库中数据的基本 ANSI 标准。当您看到“MSSQL”时,它指的是 Microsoft SQL Server,它是整个数据库架构,而不是一种语言。T-SQL 是 Microsoft SQL Server 使用的专有 SQL 形式。它包括不属于 ANSI 标准的特殊函数,如 cast、convert、date() 等。

You will also see things like plSQL, which is Oracle's version of SQL, and there are others as well (mySQL has its own version, for example, and Microsoft Access uses Jet SQL.)

您还将看到 plSQL,它是 Oracle 的 SQL 版本,还有其他版本(例如,mySQL 有自己的版本,Microsoft Access 使用 Jet SQL。)

It is important to note the the ANSI standard for SQL has different releases (for example, 92 or 99, representing the year it was released.). Different database engines will advertise themselves as "mostly ANSI-92" compliant or "fully ANSI-99" compliant, etc, and any exceptions will usually be documented.

重要的是要注意 SQL 的 ANSI 标准有不同的版本(例如,92 或 99,代表它的发布年份。)。不同的数据库引擎会将自己标榜为“主要符合 ANSI-92”或“完全符合 ANSI-99”等,并且通常会记录任何异常。

So although "SQL is SQL", every engine uses its own "flavor" of it, and you do have to do a little reading on the particular platform before you just dive in.

因此,尽管“SQL 就是 SQL”,但每个引擎都使用它自己的“风格”,在深入研究之前,您确实必须在特定平台上进行一些阅读。

A further note - the SQL extensions, like T-SQL, are generally considered full-fledged programming languages, complete with looping, if/then, case statements, etc. SQL itself is limited to simply querying and updating data and is not considered a true programming language.

进一步说明 - SQL 扩展,如 T-SQL,通常被认为是成熟的编程语言,包括循环、if/then、case 语句等。 SQL 本身仅限于简单的查询和更新数据,不被视为真正的编程语言。

Wikipedia has a decent article for an overview here: http://en.wikipedia.org/wiki/SQL

维基百科有一篇不错的文章概述:http: //en.wikipedia.org/wiki/SQL

回答by Micha? Piaskowski

It depends in what context those terms are being used.

这取决于使用这些术语的上下文。

They might mean exactly the same or have a slightly different meaning in some situations.

在某些情况下,它们的含义可能完全相同或略有不同。

  • T-SQL- dialect of SQL language used in Microsoft Sql Server
  • MSSQL- Microsoft SQL Server software
  • SQL- Structured Query Language - depending on the context it might mean the sql language itself, sql database or sql database server of any kind.
  • T-SQL- Microsoft Sql Server 中使用的 SQL 语言的方言
  • MSSQL- Microsoft SQL Server 软件
  • SQL- 结构化查询语言 - 根据上下文,它可能意味着 sql 语言本身、sql 数据库或任何类型的 sql 数据库服务器。

回答by Ben M

T-SQL is shorthand for Transact-SQL, which is Microsoft's SQL dialect, whereas MSSQL usually refers to the SQL Server engine itself.

T-SQL 是 Transact-SQL 的简写,它是 Microsoft 的 SQL 方言,而 MSSQL 通常指的是 SQL Server 引擎本身。

回答by Ben M

1.SQL is a programming language while T-SQL is an extension to SQL.

1.SQL 是一种编程语言,而 T-SQL 是 SQL 的扩展。

2.T-SQL is proprietary while SQL is an open format.

2.T-SQL 是专有的,而 SQL 是一种开放格式。

3.T-SQL contains procedural programming, local variable, and such while SQL does not.

3.T-SQL包含过程编程、局部变量等,而SQL不包含。

4.T-SQL is Turing complete while SQL is not.

4.T-SQL 是图灵完备的,而 SQL 不是。

5.T-SQL has a different implementation of DELETE and UPDATE than SQL.

5.T-SQL 与 SQL 有不同的 DELETE 和 UPDATE 实现。

6.T-SQL is best if you use Microsoft SQL servers

6.T-SQL 是最好的,如果你使用 Microsoft SQL 服务器

回答by david25272

Unlike the Ottaman empire, Sybase still exists, and still uses Transact SQL. The Sybase (ASE) implementation is not exactly the same as the Microsoft one.

与奥斯曼帝国不同,Sybase 仍然存在,并且仍然使用 Transact SQL。Sybase (ASE) 实现与 Microsoft 的实现并不完全相同。

Sybase TSQL Guide

Sybase TSQL 指南