Strange query behavior (SQL Native Client could be the culprit)....

  • We have a COBOL application that is part of a batch program that connects to a SQL 2005 database via the SQL Native Client driver (driver version 2005.90.3042.00). To sum things up, we are encountering behavior that is exactly opposite to what we get when running the queries (see below) from mgmt. studio. The only difference between the 2 queries below is that one has a from clause and the other doesn't. In this example neither of the queries should return a value because the 1st date used is indeed NOT less than the 2nd. The expected behavior is received within Mgmt. studio, but when the COBOL program exectues the query, we get an 'x', which we should not get. When we run a profiler trace we see that everything beyond the 'x' gets truncated when the query (without the from clause) is sent to the db from the COBOL program.

    Would any of you happen to know if there is an ODBC setting that would correct this strange behavior?

    create table dummy (col1 varchar(1000))

    select 'x' from dummy where convert(datetime, '20050101') < convert(datetime, '20000101')

    select 'x' where convert(datetime, '20050101') < convert(datetime, '20000101')

    Thanks in advance,

    Dave

  • What version of the ODBC Driver are you using ?


    * Noel

  • SQL Native Client driver version 2005.90.3042.00.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply