Login | Register   
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: SQL
Expertise: Beginner
Dec 2, 2008

Execute a Block of Text in SQL Server Management Studio

In SQL Server Management Studio, you can use the Alt key in your keyboard to select blocks of text to execute. For instance, suppose you have the following statements:

--@DELETE FROM ORDERDETAIL
--DELETE FROM ORDER
--DELETE FROM PRODUCT
--DELETE FROM PRODUCTCATEGORY
--DELETE FROM CUSTOMER       #
You'd place the cursor where the @ symbol is, press and hold the Alt key, left click with the mouse, and drag the cursor all the way to where the # symbol is. The @ and # symbol are included here to show you the exact places, they shouldn't be included in your statement. Also keep in mind that this selection method creates a rectangle so you have to select everything to cover the longest statement.

Note how you have to drag the cursor all the way to the # symbol even when the last word was CUSTOMER. This is because Alt-dragging creates a rectangle of marked text, and you need to make the rectangle wide enoungh to select the fourth line (the longest one).

Cindy Rodriguez
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap