Why do I receive these results (?) :
Jan 1 1900 12:00AM
For a procedure that is defined as this :
create procedure mark_test(@int1 as int,@date1 as datetime)
When I call it using these empty string parameters :
exec mark_test '',''
It appears that SQL Server converts empty strings to zero (0) for int parameters, and Jan 1 1900 for datetime parameters.
I've tried to Google this to understand why this happens, but haven't found anything yet. My Oracle DBAs are citing things like this and a bunch of other little idiosyncracies for reasons why we should use Oracle instead. Can anybody help ? Is this ANSI standard behavior ?
I know - we can easily work around this problem by checking parameter values before calling the proc (ISNUMERIC, ISDATE, etc.) .. but I would like to understand why this occurs.