Controling result pane from TSQL

  • Hi,

    I'm using SQL 2k.

    I use to work with grid results pane most of the time, but for very few scripts I need to see them as text.

    Is there any way in TSQL to force specific view in result pane?

    Thanks

  • I could be wrong, but I'm pretty sure there's no way to do it via T-SQL.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • mmm... that's a missing.

    Do you know if there is any way to do a "sendkey" via TSQL?

  • Good idea about the "sendkey"... but not sure how you would do it because the "scope" of QA changes when you hit the run button. All output is directed to the results pane instead of back to QA. Even if you wrote a small .exe using something like VB, I don't believe it would work because of the scope change.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • About the only way I can think of to do this is to use PRINT to create the output if it needs to be in a Text results pain. It'll show up in the "Messages" tab.

    The other way to do is is to put a comment in at the beginning of the script to remind you.

    Or, if it's supposed to be Text instead of a Grid, you could always output it to a file.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • mmm...

    I'm thinking in something like HotKeys or so.

    I don't know if HotKeys can respond to a certain text or situation into a specific window.

    I know I can fire any event I need with a key but I don't now how to do the opposite.

    Do you?

  • Maybe a registry entry...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Thanx Jeff, but not good news:

    This key handles default for results pane: 0=Text, 1=Grid

    HKEY_CURRENT_USER\Software\Microsoft\Microsoft SQL Server\80\Tools\SQL Query Analyzer\Options\ResultsTab\DefResultsTarget

    Apparently it works only as a startup default...

    Options dialog effectively changes that value.

    But if I don't open Options dialog, results panel view remains the same, without using modified value.

  • am i totally missing something here, but if running queries in QA surely:

    ctrl T, ctrl E - results in text

    ctrl D,ctrl E - results in grid

    :ermm:

    ---------------------------------------------------------------------

  • It's official!

    I give up and decided to go "FuNctional" with HotKeys 🙂

    F2 = save

    F3 (= search again)

    F4 = open in same window

    F5 = exec with grid

    F6 = show/hide results pane

    F7 = exec with text view

    F9 = new windows

    (Anyway, this is for 2k.. maybe 2k5 or 2k8 allows a different approach)

    Thank you all.

Viewing 10 posts - 1 through 9 (of 9 total)

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