Programatically Discard Results

  • Is there a way in TSQL to programatically discard results ?

    In the query analyzer this exists in the advanced tab of the current connection options. However, I would like to turn this option on and off inside a procedure.

  • I think the QA option is to disconnect isnt it? Can you give an example of when you'd get results and then not want them?

    Andy

    http://www.sqlservercentral.com/columnists/awarren/

  • I am using commercially provided (encrypted) procedures that are not completely clean in what is returned. Sometimes I get a print result.

    When I process a large amount of records, I will get multiple lines that I am not particulary interested in which print out in the results window. If I run the procedure from the command line, then the command window will also fill up with the print results.

    Eventually, the local machine (or local server) runs out of memory.

  • rowcount or TOP will limit results, but this may not be what you need.

    Steve Jones

    sjones@sqlservercentral.com

    http://www.sqlservercentral.com/columnists/sjones

  • I have managed to get my processes running by ISQL command line redirect of output to a file. I still would like to know if there is a way to do this.

  • For OSQL and ISQL try this to find the command options:

    OSQL -?

    or

    ISQL -?

    Think you might be looking for the -o and -i options. Where -o write ISQL or OSQL output to a file, and -i is the Input commands to ISQL or OSQL.

    Is this what you where looking for?

    Gregory Larsen, DBA

    If you looking for SQL Server Examples check out my website at http://www.geocities.com/sqlserverexamples

    Gregory A. Larsen, MVP

Viewing 6 posts - 1 through 6 (of 6 total)

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