escape sequences for special characters

  • I apologize if the answer to this is obvious -- I haven't been able to find a clear description anywhere... How does SQL Server handle inputs of special characters like tabs?

    For example, I would have expected that \t would represent a tab character, but when I insert it, I get the literal sequence \t instead of a tab.

    Is the behavior any different when using OPEN ROWSET (BULK ... FORMATFILE ...) sequence?

    My preference would be to somehow enable these \t to be read as tab values and converted to tab values on insert.

  • In the T-SQL side of the house, "special" characters a created using CHAR(n) where "n" is the ASCII number of the character. For example, a TAB character is CHAR(9). Please see the following URL for a full ASCII table.

    http://www.asciitable.com/

    --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 2 posts - 1 through 1 (of 1 total)

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