Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Shortcut to duplicate line in SQL Server Studio Management?

Tags:

In Netbeans and Eclipse you can hit CTRL + Shift + Down (i think thats netbeans) and it will duplicate a line of code. Is that possible in SQL Server Management Studio? This is running with SQL Server 2008

like image 643
zach Avatar asked May 18 '11 20:05

zach


People also ask

What is CTRL L in SSMS?

To find this out, press CTRL+L to display the estimated query execution plan as shown below without actually running the whole query (in fact it runs for top 1 row).

What does CTRL e do in SQL Server?

Ctrl + R should show/hide result pane. Ctrl + E should execute the query.

What is the use of Alt F1 shortcut key in SQL?

Enter the SQL Server Management Studio (SSMS) shortcut key ALT + F1. Highlighting a table object in code and then pressing ALT + F1 with in the SSMS IDE will execute the equivalent command of sp_help 'object_name' where object_name is the name of the highlighted object.


2 Answers

I think that you can hit CTRL + C without any text selected and in clipboard you got full line after that hit enter and paste line.

Ill check in morning is it working in MGM2008 I use 2005.

like image 180
adopilot Avatar answered Sep 18 '22 11:09

adopilot


If you're using SSMS 18.0 or above and don't use the shortcut for Results to Grid (which currently occupies CTRL+D), then you can update the key bindings in the Options menu.

  1. Go to Tools -> Options -> Environment -> Keyboard
  2. Under Show commands containing, search for Edit.Duplicate

Keyboard section of Options dialog box in SSMS showing Edit.Duplicate

  1. Select the Press shortcut keys box and press CTRL+D
  2. Now search for Query.ResultstoGrid
  3. Remove both of the shortcuts for CTRL+D.

When you click "OK" to leave Options, you should find that you can use the key binding straight away.

Edit: Added confirmation that this is only supported from SSMS 18.0 onwards (h/t @Darrin for confirming)

like image 23
Myles Avatar answered Sep 20 '22 11:09

Myles