Results 1 to 6 of 6
  1. #1
    Join Date
    Jul 2002
    Posts
    229

    Unanswered: Some PRINTs won't print anything

    I'm trying to use the PRINT statement to trace what an SP is doing, while
    running in QA.
    However, some PRINTs seem not to print anything. I can see that the
    code part is being executed.
    Any ideas? (It's just simple prints like print 'executing an insert' .)

  2. #2
    Join Date
    Nov 2004
    Location
    on the wrong server
    Posts
    8,835
    Provided Answers: 6
    Are the values you are trying to print null or numeric datatypes. you may want to use cast and coalesce.
    “If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry.” Earnest Hemingway, A Farewell To Arms.

  3. #3
    Join Date
    Jul 2002
    Posts
    229
    It's just a string literal.
    One step in the SP is a long-running FTP (through xp_cmdshell).
    Might have something to do with the problem. Maybe the output before
    the FTP is put on hold until the FTP finishes, for some reason.

  4. #4
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    some code would really help
    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.

  5. #5
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,800
    Provided Answers: 11
    In general, I believe SQL Server waits to fill up the Network Packet size, before shipping results to the client. If you do not have enough results to "fill the crate", SQL Server will wait until you do to save on postage. Try this:
    Code:
    select *
    from pubs..authors
    print "Starting big operation"
    
    waitfor delay '000:00:05'
    
    print "Done"

  6. #6
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,800
    Provided Answers: 11
    Actually, for a better example, substitute the Northwind..orders table.

Posting Permissions

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