Microsoft
Software
Hardware
Network
Question : SQL Server 2005 Casting behaviour
select cast('*' as int)
GO
--- Conversion failed when converting the varchar value '*' to data type int.
GO
select cast('+' as int)
GO
-- This works fine
-- Result- 0
GO
select cast('-' as int)
GO
-- Works Fine
-- Result 0
GO
select cast('/' as int)
GO
-- Conversion failed when converting the varchar value '/' to data type int.
GO
I am unable to understand why few airthmetic operator working fine but few not...
any one could you please explain this behavior.. I am working to fix one production issue....
Answer : SQL Server 2005 Casting behaviour
You aren't casting the addition and subtraction operators, you are casting the positive and negative notation and it just makes the assumption that the numeric part is 0. +0 = + = 0
Random Solutions
Capturing handwriting
How to install XP with F6 driver requirement and no floppy
Which Controller for 4 HD, RAID 1 mirrored drives?
Inline attachments with Lotus Notes
Mitel Teleworker One Way Audio
Outlook Web App (OWA) 2010 defaults to light version for specific user
How to remove automatic login from Outlook 2010
How to determine hard disk activities
windows 2008 MYSQL5.1 and PHP5
I/O error reported on file system /oracle/P1U aix hdisk path vio