Forgot Password,

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

You must login to ask a question.

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

databaseanswers.net Latest Questions

  • 0
Ben Bixby

How to find names with 2-byte characters, regardless of collation?

My CUSTOMER table has some characters that are causing a downstream XML process to bark. It appears to be where LAST_NAME has a two-byte character. I’ve reviewed this SQL Server question which explained collation. But I’m still stuck. I notice that some characters are 2-bytes. I’m using AL32UTF8 and UTF8 character sets.

How can I find the last_names with 2 byte characters?
Is that the question I should be asking if I want find all 2-bytes characters regardless of the collation?

2byte character

Related Questions

Leave an answer

You must login to add an answer.

2 Answers

  1. for the basic check of bytes != characters you can do something like

    select * 
      from customer
     where length(last_name) != lengthb(last_name); 
    

    but as NullUserException stated, depends how you really want to define special characters.

  2. Look here:

    http://docs.oracle.com/cd/E11882_01/server.112/e26088/functions233.htm#SQLRF06162

    SELECT last_name, VSIZE (last_name) "BYTES"      
      FROM employees
     WHERE department_id = 10
    ORDER BY employee_id;
    
    LAST_NAME            BYTES
    --------------- ----------
    Whalen                   6