dbTalk Databases Forums  

Selectively Executing Interactive SQL in Management Studio

comp.databases.ms-sqlserver comp.databases.ms-sqlserver


Discuss Selectively Executing Interactive SQL in Management Studio in the comp.databases.ms-sqlserver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
bill
 
Posts: n/a

Default Selectively Executing Interactive SQL in Management Studio - 10-18-2008 , 08:13 PM






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
<shift> key 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>Execute 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>Execute 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

Reply With Quote
  #2  
Old   
Erland Sommarskog
 
Posts: n/a

Default Re: Selectively Executing Interactive SQL in Management Studio - 10-19-2008 , 04:37 AM






bill (billmaclean1 (AT) gmail (DOT) com) writes:
Quote:
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>Execute 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>Execute 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 (AT) sommarskog (DOT) 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



Reply With Quote
  #3  
Old   
Fredy Muņoz
 
Posts: n/a

Default Re: Selectively Executing Interactive SQL in Management Studio - 03-31-2011 , 12:38 PM



There is already a suggestion in Connect. You can vote here:
https://connect.microsoft.com/SQLSer...-for-execution

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.