SQL_MODE=MSSQL

SET SQL_MODE=MSSQL is an alias for the following sql_mode:

PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,MSSQL,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,
NO_FIELD_OPTIONS

In MariaDB 10.4.5 and later, setting the sql_mode system variable to MSSQL allows the server to understand a small subset of Microsoft SQL Server's language. For the moment MSSQL mode only has limited functionality, but we plan to add more later according to demand.

Supported Syntax in MSSQL Mode

Using [] for Quoting

One can use [] instead of "" or `` for quoting identifiers:

SET SQL_MODE="MSSQL";
CREATE TABLE [t 1] ([a b] INT);
SHOW CREATE TABLE [t 1];
Table  Create Table
t 1    CREATE TABLE "t 1" (
  "a b" int(11) DEFAULT NULL
)

You can use '[' in identifiers. If you want to use ']' in identifiers you have to specify it twice.

See Also

Comments

Comments loading...