Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2004

    Unanswered: Display Results Based on Query


    I don't know if anyone has encountered this before but here goes:

    I've a select clause below:
    result = "Select * from person where LocalName LIKE N'" + queryLocalName + "'"
    queryLocalName is an input field that allows the user to search for non-English characters in the database.

    What I'm wondering is what kind of effect is the N in the where clause is having?

    I can't seem to get it to work when doing it via the web. I've tested in the database itself, got it to work using the SQL Analyser but when testing on the web, it can't find because ? are appearing in the result.

  2. #2
    Join Date
    Jul 2004
    The 'N' in your query tells SQL Server that the bit in quotes is Unicode. That means that the data in queryLocalName has to be either ANSI for regular Latin text or Unicode for other languages. My guess is that queryLocalName is not in Unicode. From what I remember of this a year or so ago when I was involved in 'languagizing' a site it depends on the encoding of the .asp files (seriously) and the content-type meta tag in your page.

    What I would do is to print out the character values of queryLocalName to verify they are Unicode -- you could enter the same text into your database via Query Analyser and print them side by side.

    You SQL is correct, the data you are passing is not.

  3. #3
    Join Date
    Oct 2004
    Thanks for the explanation. I'll check that the data is in Unicode.

Posting Permissions

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