Results 1 to 6 of 6

Thread: not in and sql server version

  1. #1
    Join Date
    Nov 2002
    Posts
    261

    not in and sql server version

    I have a client DB running sql server 8.00.760 which has a query which will not run correctly ( it has a sql statement which last_name not in (select p.last_name from table p).

    I copied the db back here and the same statement runs fine. We are running 8.00.977
    Has anyone seen this before?

  2. #2
    Join Date
    Feb 2003
    Posts
    1,048
    You have to give us a little more information than that. What do you mean by "will not run correctly"?

    Does it give different results than you expect? Does it give you an error? Or what?

    What is the actual query? So many time the "sample" query people post on here is different than the query they are actually running and as a result, the help we provide doesn't apply.

    Check the client db to see if it is set to be case-sesitive by using upper() or lower(). If more records are returned, then it is case-sensitive.

    Where Upper(last_name) not in (select Upper(p.last_name) from table p)

  3. #3
    Join Date
    Nov 2002
    Posts
    261
    What we are seeing was no records returned, when there should have been. We discovered there were some null values in this field. We removed those and it worked. To me it still seems it should have worked anyhow

  4. #4
    Join Date
    Sep 2002
    Posts
    5,938
    Did you compare 'ANSI null default' setting between you and your client?

  5. #5
    Join Date
    Nov 2002
    Posts
    261
    no, I did not, should I do this at db level or tsql

  6. #6
    Join Date
    Sep 2002
    Posts
    5,938
    Don't think in db level since you got copy from your client. You can check server connection settings in properties page in em, and connection properties in query analyzer's option setup.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •