Miracle, Bug Or My Ignorance ???

May 12, 2004

select

'[Cust Code]' ColName
,RowId
from
Temp_Upload_Table
where

[cust code]
not in ( select Convert(Float,KUNNR) from KNVV_View
where isnumeric(kunnr) = 1)

The code above is giving an error

Server: Msg 8114, Level 16, State 5, Line 1
Error converting data type varchar to numeric.


The [cust code] column is float .


The subquery select Convert(Float,KUNNR) from KNVV_View where isnumeric(kunnr) = 1 when executed alone gives correct result. When i put is as subquery it bombs ...

Is this a miracle, a bug or is there something I need to know ???

View 14 Replies


ADVERTISEMENT

Sysdtslog90, Message Field And My Unicode Ignorance

Feb 5, 2008

Sorry to be an ignorant American here, but I'm having a challenge I just can't seem to wrap my head around.

I am attempting to make a nice query for a report that will show how our SSIS jobs are doing. All my packages use the native SQL Server logging capability. The table is sysdtslog90 and it stores the message to a field called 'message' (crazy, I know) with a datatype of nvarchar(4096).

The challenge I'm having is that I'd like to grab all lines where my message is X. The following queries will return no results. The first is me typing in the message I see in the window, the second is copying the value and pasting it in. I know there are instances where that message exists, sadly, in the log table.




Code Snippet

SELECT

L.*

FROM

sysdtslog90 L

WHERE

L.message = N'A commit failed.'


SELECT

L.*

FROM

sysdtslog90 L

WHERE

L.message = N'A commit failed. '





If I were to change that clause out to a like, it'd work just fine. Is that the appropriate way to work with unicode literals? It doesn't feel right.




Code Snippet
SELECT
L.*
FROM
sysdtslog90 L
WHERE
L.message LIKE N'A commit failed.%'




I have exported my sysdtslog90 table to a unicode flat file and looked at this message in a hex editor and it looks fine, nothing looked awry. I then opened the file up in SSMS, thinking perhaps it's a silent conversion issue with pasting, but to no avail. Anyone have some guidance for me?

View 6 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved