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
Move Sharepoint 2010 DB's from one server to another
Dot Net IL Code to C# conversion
Project Server 2010 won't install
Limiting User Access
Javascript form validation problems
Boot Acer Ferrari 1200 laptop from dvd to upgrade vista to windows 7
Ajax or flash..For online Jewellery designer ?
Test javamail through command line
Detect Session State TimeOut
windows 2008