Why cast/convert from int returns an asterisk

前端 未结 2 570
名媛妹妹
名媛妹妹 2020-12-03 01:07

Someone recently asked me this question and I thought I\'d post it on Stack Overflow to get some input.

Now obviously both of the following scenarios are supposed to

2条回答
  •  爱一瞬间的悲伤
    2020-12-03 01:29

    You can read on the CAST and CONVERT page on the "Truncating and Rounding Results" section. Int, smallint and tinyint will return * when the result length is too short to display when converted to char or varchar. Other numeric to string conversions will return an error.

提交回复
热议问题