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
Forefront TMG Client Access
FTP Script via Unix
How to insert a single blob?
Outlook2007/ Exchange: Need password to connect
Can't send emails (Vista Business, United Kingdom, Demon Mailbox/Demon Broadband)
Lable (and other elements) not appearing in my code behind
PHP: import several RSS feeds into MySQL
Quickr..How do I edit the tabs on the home page of my place? I want to add a tab
Exchange database backup failing with Arcserve v15
Inserting Rows in Excel with VBA