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
Outlook/Exchange Issue with Emails not showing
How to make simple PHP IF function for the following simple scenario ?
ATM clocking
IPSec VPN to Watchguard XTM 505 behind Draytek 2820
Best routers for creating a VPN tunnel between two offices
science behind typing fast
LDAP query help
Cisco router configuration for internet access
How do i apply formatting to all hyperlinks in Word 2007?
Move jpg files from file server and create shortcut