The optional time zone indicator, Z, is used to make it easier to map XML datetime values that have time zone information to SQL Server datetime values that have no time zone. Other time zones are indicated with HH: MM offset in the + or - direction. When you convert to character data from smalldatetime, the styles that include seconds or milliseconds show zeros in these positions.You can truncate unwanted date parts when you convert from datetime or smalldatetime values by using an appropriate char or varchar data type length.When you convert to datetimeoffset from character data with a style that includes a time, a time zone offset is appended to the result.
Note: When you convert to the xml data type, SQL Server insignificant white space is handled differently than in XML 1.0.
For more information, see Create Instances of XML Data. If enabled, the server can use the following information that is provided in an internal DTD subset to perform nonvalidating parse operations. -Internal entity references are resolved and expanded.
-The DTD content model will be checked for syntactical correctness. It also does not evaluate the XML declaration to see whether the standalone attribute is set yes or no, but instead parses the XML instance as if it is a stand-alone document.
is set to 1 the characters 0x must be the first two characters in the expression.
If the expression contains an odd number of characters or if any of the characters are invalid an error is raised.
If the length of the converted expression is greater than the length of the that are larger then the converted result will have zeros added to the right of the result.
If the data_type is a character type, the expression must be a binary expression.
Each binary character is converted into two hexadecimal characters.
-- Syntax for SQL Server, Azure SQL Database, Azure SQL Data Warehouse, Parallel Data Warehouse -- Syntax for CAST: CAST ( expression AS data_type [ ( length ) ] ) -- Syntax for CONVERT: CONVERT ( data_type [ ( length ) ] , expression [ , style ] ) can be one of the values shown in the following table. For example, the value '2012-11-07T.000 is displayed as '2012-11-07T'.yyyy-mm-dd Thh:mi:Z (no spaces) Note: When the value for milliseconds (mmm) is 0, the milliseconds value is not displayed.