How see output from print statement when sp called from JDBC

  • Hi

    If you put helpful debugging print statements in your TSQL how do you get to see them when you execute the stored procedure from something other than Query Analyzer e.g. from a JAva program.

    I think they might be appearing on a console somewhere? If so how can you see that remotely?

    Thanks

    Sean

  • Can you not cycle through the recordset and use the print statement for the application in the debug window?

    I often do this in vb. Alternatively, you can insert the recordset into a temporary table or a text file and see what that brings back.


    ------------------------------
    The Users are always right - when I'm not wrong!

  • It is not a result set that I am printing via PRINT statement - it is debug trace information.

     

  • I think you can cheat and just look at the SQL Server error log file which includes console output (i.e. your print statements). Not 100% sure since I haven't got permissions on the box (yet). The error log file is usually in:

    c:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG

  • In ADO, Print text appears in the Errors collection:

    DBConn.Errors(n).Description

    There might be difficulties with timing - they might only appear after the recordset (all recordsets?) is fully retrieved.

Viewing 5 posts - 1 through 4 (of 4 total)

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