Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL Management Studio - Execute current line

Tags:

ssms

In SQL Server 2008 Management studio, I can hit F5 to execute everything in the current query window. I can also highlight a query, and hit F5 to run that highlighted query.

Instead of having to highlight a query, is there a way I can run the single query my cursor is on, or run a query my cursor is on up to a the first ';'?

like image 456
mawaldne Avatar asked Apr 16 '10 20:04

mawaldne


People also ask

How do you select an entire line in SSMS?

Shift + Home will do the job perfectly.

How do I run a part of a SQL code?

To partially execute a query In SQL Server Object Explorer, double-click PerishableFruits under Views to open it in Transact-SQL editor. Highlight the SELECT p.Id, p.Name FROM dbo. Product p segment in the code, right-click and select Execute Query.


1 Answers

In options you can configure line numbers to be displayed, then you can just click on a line number, which will highlight the whole line.

like image 109
Salem Avatar answered Sep 23 '22 12:09

Salem