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
passing a looped value to a form
PL/SQL Performance
Getting group membership from LDAP
How to commit changes of a Typed Dataset to database at once
SQL 2008 SP1 Ghost count!
Dynamic Color
C# 2005 how to Change the Target .NET Framework Version of an Existing Project
a program is attempting to send the following email message on your behalf - Windows Live mail
Setting up FTP Users on IIS 7.5
Web Interface 5.3 PNAgent Site - Citrix Online Plug-in could not contact the server entered.