Errors, refused statements and known differences
SQL Server error numbers, what is refused and how the behaviour differs from SQL Server.
Errors#
The table of mappings (with tests) is: 208, 207, 209, 102 / 156 (syntax; 156 when the next word is a reserved word), 2627, 2601, 515, 2628 (string truncation: the text with Truncated value is SQL Server 2019+'s message 2628; 8152 is sent only when the value is not known), 547 (foreign key, reference, check), 245, 241, 8115, 8134, 2714, 1801, 911, 3701, 3702, 3726, 2705, 1913, 8110, 195, 109/110, 4060 and 18456 (login), 137 (undeclared variable), 544, 3902, 3903, 2812. Anything else is 40000 with Raft DB: and the engine's text. Parse errors reject the whole batch before anything runs (as SQL Server does).
Refused (clearly, with number 40000 ... is not supported by the Raft DB SQL Server front-end.)#
Filtered indexes (except a unique one WHERE col IS NOT NULL), CLR (error 6263), Service Broker, Always Encrypted keys, FOR XML EXPLICIT / XMLSCHEMA / XMLDATA and AUTO over several sources, HASHBYTES('SHA2_512'), MERGE TOP, INSTEAD OF triggers for a statement with a FROM, ALTER TABLE ... ADD of an identity column, TOP ... PERCENT WITH TIES, WAITFOR (RECEIVE ...), a CONTAINS condition that mixes AND and OR, geometry / geography; the other items of D95's list. INTERSECT ALL / EXCEPT ALL are SQL Server's own error 156 (it has neither). MARS is not done: SqlClient connects with MultipleActiveResultSets=True and then refuses a second command while a reader is open (There is already an open DataReader associated with this Command which must be closed first.).
Known differences from SQL Server#
The server name in messages and
@@VERSIONtext; object ids; times.datetime2(7)has six real digits;varcharandnvarcharstore alike (no?for characters outside the code page); the default collation is the engine's comparison, case-insensitive and accent-sensitive likeSQL_Latin1_General_CP1_CI_AS(stage 6 adds the others, see "Stage 6").A
varbinaryvalue with bytes that are not valid UTF-8 is not stored exactly (the engine keeps text).FOR XMLandFOR JSONgive one row (SQL Server cuts the text into rows of 2033 characters).CHECKSUMis a CRC32; its numbers are not SQL Server's.A cancel (attention) stops a
WAITFORor the next statement of a batch; a statement that is already inside the engine runs to its end.A bulk load message is kept in memory (up to 256 MiB; use
BatchSize), runs in one transaction and fires no triggers.READ UNCOMMITTEDis the only isolation.Unnamed constraints are named
PK__table,UQ__table__cols(SQL Server adds a hash).Each statement that changes a table's definition also writes the front-end's two hidden tables in that database.
Stage 4: the engine's time is UTC (so
GETDATE()is UTC); the history table of a temporal table is a view while versioning is on;SET (SYSTEM_VERSIONING = OFF)rebuilds the table (foreign keys to it and its triggers are lost); asql_variantis kept as text with its base type in front and compared as text; types and synonyms made by another session are seen after reconnecting; the full-text words are the engine's;varchargoes out in code page 1252 and comparisons ignore case (no CS or BIN2 collations);BULK INSERTreads only below--import-dir.Other known differences:
UPPER('straße'), error 220 for atinyintcolumn,CASTbetween integers andbinary, the seventh digit ofdatetime2(7)and some details of the catalog.Stage 5: the
typecolumns ofsys.objects,sys.tables... holdU,P,Vwithout the blank ofchar(2); a schema is a name prefix of the engine's table,INFORMATION_SCHEMAandGRANT ... ON SCHEMA::follow it since stage 6 (a schema is a name prefix of the engine's table,sys.schemasandsys.tables.schema_idfollow it); object ids are CRC32 numbers; the dates of catalog rows are the time of the question; a default made without a name shows asDF__table__column(a named one by its name since stage 6), an unnamed primary key isPK__table; aCHECKadded withALTER TABLEis not insys.check_constraints;sys.databasesandDATABASEPROPERTYEXshow fixed values (SIMPLE,READ_WRITE) whateverALTER DATABASE ... SETsaid;sp_configurevalues have no effect; the plans ofSHOWPLAN_*are a table scan per table and the numbers ofSET STATISTICS IOcome from the table size; permissions: aDENYanywhere wins (SQL Server lets a grant on a narrower scope override a deny on a wider one in some cases), server permissions and the fixed server roles other thansysadminhave no effect,EXECUTE ASneeds asysadmin, code in routines is not checked;sys.dm_exec_requestsshows only the asking session; Agent schedules never fire;CREATE LOGINhas no password policy (CHECK_POLICYis read and ignored);CREATE USER ... WITH PASSWORD(contained users) is not read.
Stage 7 (D127) took server cursors, LIKE ... ESCAPE / PATINDEX / FORMAT with values that are not literals and mixed CONTAINS conditions off this list; what is still refused after it is listed at the end of Stage 7.
The second pass (D136) took AT TIME ZONE, SWITCHOFFSET, TODATETIMEOFFSET, DATE_BUCKET, the WINDOW clause, IGNORE NULLS, << / >>, MERGE TOP, HASHBYTES('SHA2_512'), COMPRESS / DECOMPRESS, NEWSEQUENTIALID, TYPEPROPERTY, CONVERT styles 22 / 130 / 131, FORMAT of a time, ALTER TABLE ADD of an identity column and Reduce of lines off this list (Second pass). Still refused: hierarchyid, STBuffer, BufferWithTolerance, MakeValid, Reduce of a polygon, FORMSOF and NEAR with a distance. Known differences: COMPRESS of a longer value gives other bytes than SQL Server (both decompress), and IDENT_CURRENT of an identity column fed by a sequence is NULL.
Stage 9 (D146) took hierarchyid, STBuffer / BufferWithTolerance of points, MakeValid of a valid shape, Reduce of a polygon and MERGE TOP with WHEN NOT MATCHED BY SOURCE off this list (Stage 9). Still refused: STBuffer of lines and polygons, MakeValid of an invalid shape, STUnion / STIntersection / STDifference / STSymDifference, FORMSOF and NEAR with a distance, and the out-of-scope features listed there.