Home Forums SQL Server 2005 T-SQL (SS2K5) Unexpected Result of Select Statement: Shubham Saxena RE: Unexpected Result of Select Statement: Shubham Saxena

  • This is documented in the Truncating and Rounding Results section of CAST and CONVERT in Books Online. The * means 'Result length too short to display'. This odd behaviour is maintained for backward compatibility with old versions of SQL Server. The more modern types nchar and nvarchar return an error instead:

    SELECT CAST(643 AS nvarchar(1));

    SELECT CAST(45 as nchar(1));

    [font="Courier New"]Msg 8115, Level 16, State 2, Line 1

    Arithmetic overflow error converting expression to data type nvarchar.[/font]