Why does this query return me *
?
select convert(varchar(2), 141)
I thought it was the ascii table, but the 141, does not match the *.
I use SQL Server 2008 R2
Why does this query return me *
?
select convert(varchar(2), 141)
I thought it was the ascii table, but the 141, does not match the *.
I use SQL Server 2008 R2
When integers are implicitly converted to a character data type, if the integer is too large to fit in the character field, SQL Server returns character 42 of the ASCII Table, the asterisk (*). >
Soon any number larger than 2 characters will return *
. If you want to display 141, just increase the number of characters:
select convert(varchar(3), 141)
Return: 141.
Source: Technet