:::: MENU ::::

Copy and paste among multiple lines in SSMS

  • Feb 20 / 2012
  • 0
dbDigger, SSMS tips and tricks, T-SQL Tips and Tricks

Copy and paste among multiple lines in SSMS

SQL Server Management Studio (SSMS) is my favorite tool and m fan of it right from its start with SQL Server 2005. With every new release SSMS got more coll features for DBAs. Recently i came across a very useful feature in SSMS query pane. It allows to select specific content from multiple lines in query pane. This feature is extremely helpful when we are required to select table names, column names or even values from the script. The selected values may be deleted or copied as required. And may be paste in same alignment any where among the text.

Basically the technique is to hold the ALT key and drag the mouse on required text in SSMS query pane. Following is an example of its usage and you may use it for many tasks in more creative manner.
Suppose i am required to select just table names given in three seperate T-SQL statements. I would press ALT key and start dragging the mouse on required data. The selection would be as shown in following snap
select data from multiple lines in SSMS

Now we may copy data for onward use. It is notable that during the paste process data would preserve its alignment that was during the copy process. Spend some time to play with this cool feature and make use of it.

Consult us to explore the Databases. Contact us