locked
sql query RRS feed

  • Question

  • is there any query in sql to print next line like:-
    abc
    xyz
    Friday, February 12, 2010 8:44 AM

Answers

  • is there any query in sql to print next line like:-
    abc
    xyz

    You can use the carriage return or line feed to achieve this.

    Something like..

    PRINT 'abc' + CHAR(10) + 'xyz'
    or
    PRINT 'abc' + CHAR(13) + 'xyz'

    It does not work with a SELECT - The CHAR(10) and CHAR(13) simply converts to a space..ie...abc xyz.
    Clive
    http://www.sqlsvrdba.com
    Saturday, February 13, 2010 2:27 PM

All replies

  • Can you please give more information about what you are trying to achieve?
    Friday, February 12, 2010 5:53 PM
  • is there any query in sql to print next line like:-
    abc
    xyz

    You can use the carriage return or line feed to achieve this.

    Something like..

    PRINT 'abc' + CHAR(10) + 'xyz'
    or
    PRINT 'abc' + CHAR(13) + 'xyz'

    It does not work with a SELECT - The CHAR(10) and CHAR(13) simply converts to a space..ie...abc xyz.
    Clive
    http://www.sqlsvrdba.com
    Saturday, February 13, 2010 2:27 PM