Skip to content

SQL standards and T SQL

Kristina edited this page Nov 2, 2017 · 1 revision

All database vendors adopt a standard for SQL then add custom functionality on top of that standard.

SQL has been accepted as the standard language for relational databases by the ANSI and the ISO/IEC. So in Oracle and Microsoft SQL Server databases there are several statements that work in both vendor’s databases. For example the CAST statement works in Oracle and Microsoft SQL Server databases because it’s part of the SQL standard.

Microsoft invented it’s own SQL language called T-SQL which has additional functionality that is not available in standard SQL. For example the CONVERT statement is only used in T-SQL. The CONVERT statement does the same thing as the CAST statement but it allows you to do formatting which the CAST statement does not support.

When choosing between using the T-SQL specific statements or SQL statements you should always use the SQL standard because it’s more portable. It will allow you to switch your application to use a different database vendor without having to change the SQL statements in the code because they aren’t supported by the new database vendor.

Clone this wiki locally