Home Forums SQL Server 2012 SQL Server 2012 - T-SQL Why SQL Server converts '' to zero RE: Why SQL Server converts '' to zero
John Mitchell-245523
SSC Guru
Points: 148809
More actions
July 25, 2013 at 8:00 am
#1635719
This indeed returns 0:
SELECT CAST('' AS int)
It's just the way it works. I suppose when the DBMS or the standards were being written, somebody decided that '' would convert to 0 rather than throwing an error.
John