Accents not recognised after generate script table data

  • Hi,

    I've some tables with varchar data type in some columns.

    This tables store static values, so i need to generate scripts for create table and table data.

    I generate the scripts, but when i run them in another database to add this table and this data,

    the characters with accent are not being recognised. So i get this: 'n�mero' instead of this: 'número'.

    How do i do this correctly?

    Thanks in advance.

  • What are you collation settings set to in each database? Are they they the same?

    For better, quicker answers on T-SQL questions, click on the following...
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    For better answers on performance questions, click on the following...
    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

  • Yes, the database collation are the same: latin1_general_CI_AS.

  • amns (5/24/2011)


    Hi,

    I've some tables with varchar data type in some columns.

    This tables store static values, so i need to generate scripts for create table and table data.

    I generate the scripts, but when i run them in another database to add this table and this data,

    the characters with accent are not being recognised. So i get this: 'n?mero' instead of this: 'número'.

    How do i do this correctly?

    Thanks in advance.

    What do you get when you run this against your DB?

    SELECT DISTINCT ASCII(SUBSTRING(column_name,2,1)) AS ascii_number

    FROM dbo.table_name

    WHERE column_name like 'n_mero' ;

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • Well, i get this for the both options:

    column_nameascii_number

    n?mero 63

    número 250

    I'm supposing this is because the way i run this scripts.. i use a c# application where i'm reading the file content without specifying Enconding..

    I just have tryed to read the file specifying Encoding and i get it work using UTF-7, but in other scripts i get an error that before a didn't get. :S Should i specify any specific encoding to get all scripts work well?

    Thanks!

  • Yes, you have an Encoding issue where you;re munging the data somewhere between the file and the database. I assume the data is correct in the file but you may want to check on that too 😀

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • Yes, it's an encoding issue. Thanks for the tips! 🙂

  • Happy to assist 😀

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

Viewing 8 posts - 1 through 7 (of 7 total)

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