Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2004
    Location
    Riverside, CA
    Posts
    21

    Question Unanswered: Char(10) breaking query

    I have been working on a pretty ugly stored procedure recently, while debugging I added a char(10) to the end of each line of the SQL query so I could copy it to query analyzer(QA) and debug the SQL syntax output from of the stored procedure.

    It had no effect on the stored procedure working, but when I copied the query to QA it got the error below, so I removed them all and added them in one line at a time to find the problem.

    --Server: Msg 170, Level 15, State 1, Line 3
    --Line 3: Incorrect syntax near ','.

    Below are the 2 querys, the only difference is the Char(10) between Amt6 and Amt7!

    http://www.rakbiz.com/download/broken.txt
    http://www.rakbiz.com/download/working.txt


    I also tried char(13) with same results.

    any ideas why this is happening or how to add line breaks for readability without this problem?

    Thanks for your help!

  2. #2
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Why is the code all on 1 line?

    Ir's generated code isn't it.

    Kind of hard to debug it without being formatted...
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  3. #3
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    You've been living in the *nix world too long! Windoze uses CRLF (aka Char(13) + Char(10) in SQL) instead of just LF (Char(10), aka NewLine) to separate lines.

    -PatP

  4. #4
    Join Date
    Aug 2004
    Location
    Riverside, CA
    Posts
    21
    Thanks Pat for the tip, that was it, I would never have guessed!

    Actually I am from *ax backgroup

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •