box like charecter

  • when I import data from a text file into sql server at the end of the row I am getting a box like of charecter. whats that character?

     

    thanks.

  • it is most likely ascii characters, you should be able to use the ascii function in conjunction with the replace function to get rid of these. Should be able to include this in the import job.

     

  • Sounds like your typical end of line character.......which would be CHAR(10) and/Or CHAR(13)

     

  • It may be any of non-printable charachters.

    It's just the way EM displays presence of such charachters.

    _____________
    Code for TallyGenerator

  • Yes,

     

    It's a non-printabla character and can only be viewed in EM not in query analyzer.

    Whatcan we call that number?

    What would be the ascii number for that character.(its neither char(10) not char(13))

    Thanks.

  • > What would be the ascii number for that character.

    You have the data, so you can go look -- people here do not have the data, so they cannot say.

    I'd suggest looking at the source in a binary (hex) editor -- or as someone has suggested, you could use a T-SQL query to find out.

  • Hilight the character, copy it, and paste it into the 'X' below in QUERY ANALYZER... it'll tell you what the character number is...

    SELECT ASCII('X')

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • It will not work this way.

    You will see the code of EM replacement character, not the one has been replaced.

    SELECT ASCII(SUBSTRING(<ColName>, <StartPosition>, 1))

    _____________
    Code for TallyGenerator

  • Haven't tried it in Enterprise Manager... works fine in Query Analyzer...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Just to pitch in

    SELECT CAST([columnname] as varbinary(8000))

    will display the string in hex and you can see what and how many non printable chars (typically less than 0x20) are at the end of the string

    Far away is close at hand in the images of elsewhere.
    Anon.

  • Now there's an idea... thanks for pitching in...   hadn't thought about that approach.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 11 posts - 1 through 10 (of 10 total)

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