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
‘Browse’ button component in jsf
Why Not able to read excel file in the Web application running on Windows7/Office2010?
Using a query to filter a subreport?
ForeFront TMG Intermittent Internet Connection
Replace sring on the first line and then replace ALL the following string(2 to eof)
Sort Mysql table with recent entries
Dot Net Written Test and Interview questions, Can any 1 suggest link
How do I create a class that handles file I/O for a car rental reservation program?
Server 2008 R2 - Can Connect to Server By IP, but not computer name
VB.net 32bit&64bit COM Refereces?