Adding a Carriage Return to sql statement???

  • Yes, I do generate the code and then cut & paste into another window to execute...

    The sql code using the REPLACE statement worked for what I need to do...

    Thanks a lot for all of your assistance.

    ...Michelle

  • Is this a one time deal or permanant maintenance of the DB?

  • Ummm.... why don't you just store it in a variable and execute it using EXEC or sp_ExecuteSQL ???

    --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)

  • ... or use Xp_ExecResultSet (works only for 2000, not for 2005).

  • Once you appreciate that end-of-line is no more significant in T-SQL than space or tab, using multiline string literals will seem a lot clearer than concatenating char(13) everywhere.  The color-coding tells you it's all one string, the fact that it's on two lines tells you there is a line break.  You don't even have to worry about whether it should be char(13) or char(13) + char(10).

    I know it's hard to believe, and I'm old enough to find it bewildering myself, but you do occasionally run into programmers who don't have "carriage return = char(13)" embedded in their DNA.  I hate having to explain it.

Viewing 5 posts - 16 through 19 (of 19 total)

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