Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why Did Microsoft Create its Own SQL Extension (T-SQL)?

What are the reasons behind Microsoft implementing its own SQL extension as Transact SQL (T-SQL)? What are its advantages over the normal SQL?

like image 421
yoitsfrancis Avatar asked Jul 14 '09 06:07

yoitsfrancis


People also ask

Why do we use T-SQL?

T-SQL or Transact SQL is the query language specific to the Microsoft SQL Server product. It can help perform operations like retrieving the data from a single row, inserting new rows, and retrieving multiple rows. It is a procedural language that is used by the SQL Server.

What's the difference between T-SQL and SQL?

While T-SQL is an extension to SQL, SQL is a programming language. T-SQL contains procedural programming and local variable, while SQL does not. T-SQL is proprietary, while SQL is an open format.

What does T-SQL stand for?

T-SQL, which stands for Transact-SQL and is sometimes referred to as TSQL, is an extension of the SQL language used primarily within Microsoft SQL Server. This means that it provides all the functionality of SQL but with some added extras.

What is the extension of SQL database file?

SQL Server stores data using two file extensions: MDF files are the data files that hold the data and objects such as tables, indexes, stored procedures and views. LDF files are the transaction log files that record all transactions and the database modifications made by each transaction.


2 Answers

Transact-SQL (T-SQL) is Microsoft's and Sybase's proprietary extension to SQL. Microsoft's implementation ships in the Microsoft SQL Server product. Sybase uses the language in its Adaptive Server Enterprise, the successor to Sybase SQL Server. Transact-SQL enhances SQL with these additional features:

  • Control-of-flow language
  • Local variables
  • Various support functions for string processing, date processing, mathematics, etc.
  • Improvements[citation needed] to DELETE and UPDATE statements

http://en.wikipedia.org/wiki/Transact-SQL

Wiki connects you to much more expanding information and details.

like image 26
Troggy Avatar answered Sep 27 '22 22:09

Troggy


Everybody extends SQL.

SQL isn't procedural, it's declarative. You describe what you want, and it figures out how to retrieve it using whatever indexes or hashes or whatnot is available.

But sometimes, that's not sufficient. T-SQL gives syntax to run procedural code inside of your queries. This lets you do control structures (begin-end, if-then-else), iteration and move values between local variables, temporary tables and other sources.

like image 164
lavinio Avatar answered Sep 27 '22 22:09

lavinio