Wednesday, March 11, 2015

Implicit data conversion

This is one thing that I didn't knew happened in SQL Server.

When integers are implicitly converted to a character data type, if the integer is too large to fit into the character field, SQL Server enters ASCII character 42, the asterisk (*).

If we look at below example, when integer 123 is inserted it is implicitly converted to VARCHAR successfully. But, when value with length greater than 3 is inserted, asterisk is inserted instead.




No comments:

Post a Comment