Results 1 to 6 of 6

Thread: Can't find more than 348 characters in WHERE clause

  1. #1
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    92

    Can't find more than 348 characters in WHERE clause

    I have a table with a field called description of nvarchar(4000).
    It contains the value below which is 440 characters long.

    When I select from the table with where description = the value, it will not find it.
    When I select from the table with where left(description, 349) = the first 349 chars, it will not find it.
    When I select from the table with where left(description, 348) = the first 348 chars, it finds it.

    The 349th character is a semicolon (.
    What is going on?


    'Financing Information;;Borrower under €525 Eurohypo Facility;Borrower under $2.1b SMCF;Borrower under ANZ/NAB $800 Facility;Borrower under ¥8.36 OCBC Facility;Borrower under £320 RBS/Lloyds;Borrower under €27m Taberna Facility;EMTN Guarantor;EMTN Issuer;RBS Revolver (Borrowers);RBS Revolver (Guarantors);Obligors under $485m Macquarie/CIC facility;Areal Borrowers;Areal Facility (Guarantors);Support Group Borrower;Support Group investor '

  2. #2
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    92
    On another row, I put 'Yardi Code' repeated 100 times and it found it just fine.

  3. #3
    Join Date
    Nov 2002
    Location
    New Jersey, USA
    Posts
    3,932
    Is the 349th character ; on column or the string you are comparing?

    If if it is in string then ; may be interpreted as end of sql command.

  4. #4
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    92
    The contents of the column and the string are exactly the same. That's the point - they should match no matter how many characters I compare but once I compare beyond the 348th character they don't. Also there is more than one semicolon in the string.

  5. #5
    Join Date
    Sep 2002
    Posts
    5,938
    What's db compatibility level?

  6. #6
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    92
    Sql 2005
    90

Posting Permissions

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