E021, Character string types


The specification states the following:

 Subclause 6.1,"<data type>"
 <character string type> ::=
 CHARACTER [ <left paren> <character length> <right paren> ]
 | CHAR [ <left paren> <character length> <right paren> ]
 | CHARACTER VARYING <left paren> <character length> <right paren>
 | CHAR VARYING <left paren> <character length> <right paren>
 | VARCHAR <left paren> <character length> <right paren>
 | <character large object type>

Microsoft SQL Server 2008 R2 and Microsoft SQL Server 2012 vary as follows:

Transact-SQL partially supports this feature. However, Transact-SQL generally specifies string lengths, such as those in function parameters and results, as bytes rather than characters. In addition, although the specification allows trailing blank characters to pad fixed-length strings, some Transact-SQL functions, such as LEN [MSDN-LEN], exclude trailing blanks.