Selectively Executing Interactive SQL in Management Studio

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • bill

    Selectively Executing Interactive SQL in Management Studio

    Here's a question about getting the most out of the interface when
    executing SQL in the interactive window of M

    In TOAD (a popular front end for Oracle by Quest Software), the
    equivalent of the F5 (execute) key is F9. In TOAD, if you hold the
    <shiftkey while holding the F9 key, the parser will go to read from
    the first non empty line above the cursor all the way to the last non-
    empty line after the cursor and execute the statement.

    You don't have to highlight the statement to execute it. For example
    (see statements below my signature), if the cursor were anywhere on
    the line that says "Column_B" (second statement) and you hit
    <shift>F9, TOAD is smart enough to know you just want to execute
    Statement 2. It knows not to execute Statement 1 and Statement 3
    because of the blank lines between the statements

    I find it a real pain to highlight the entire statement of interest
    when I want to execute it. This may seem like a small deal, but the
    TOAD <shift>Execut e behaviour saves a lot of time. Is there a plug in
    to Management Studio or a native option that will emulate this
    behavior of TOAD? By the way, Quest does make a version of TOAD for
    SQL Server. However, it's expensive, I didn't like the trial, and it
    doesn't do the <shift>Execut e behavior that I want.

    Thanks,

    Bill

    Example Statements below

    ---Statement 1
    SELECT
    *
    FROM
    some_table_1

    ---Statement 2
    SELECT
    Column_A
    ,Column_B
    FROM
    some_table_2

    ---Statement 3
    SELECT
    *
    FROM
    some_table_3
  • Erland Sommarskog

    #2
    Re: Selectively Executing Interactive SQL in Management Studio

    bill (billmaclean1@g mail.com) writes:
    I find it a real pain to highlight the entire statement of interest
    when I want to execute it. This may seem like a small deal, but the
    TOAD <shift>Execut e behaviour saves a lot of time. Is there a plug in
    to Management Studio or a native option that will emulate this
    behavior of TOAD? By the way, Quest does make a version of TOAD for
    SQL Server. However, it's expensive, I didn't like the trial, and it
    doesn't do the <shift>Execut e behavior that I want.
    All I can suggest is http://connect.microsoft.com/SqlServer/Feedback.
    Go there and submit a suggestion for such an option.

    --
    Erland Sommarskog, SQL Server MVP, esquel@sommarsk og.se

    Links for SQL Server Books Online:
    SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
    SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
    SQL 2000: http://www.microsoft.com/sql/prodinf...ons/books.mspx

    Comment

    Working...