SQL Server Management Studio Cycle Clipboard Ring Feature

By:   |   Updated: 2022-02-18   |   Comments   |   Related: > SQL Server Management Studio


   Free MSSQLTips webinar - "Efficient Monitoring and Management of SQL Server" (click to register)

Problem

While looking through the features in SQL Server Management Studio, one interesting feature is the Cycle Clipboard Ring. This feature is very useful especially when someone needs to copy several lines of scattered code from one T-SQL file to another. In this tip we will take a look at how to utilize the Cycle Clipboard Ring Feature in SQL Server.

Solution

Let us go through the steps to use the Cycle Clipboard Ring feature of SQL Server.

1. In SQL Server Management Studio (SSMS), click Edit > Cycle Clipboard Ring from the drop down list as shown in the screen shot below (the drop down might look a little different depending on version of SSMS). You can also access the Cycle Clipboard Ring feature using the "Crtl+Shift+V" shortcut.

using cycle clipboard ring in sql server denali

2. In SQL Server Management Studio copy and paste the T-SQL code below in a new query window.


/* First Text to Copy in Cycle Clipboard Ring */

Use master
GO

/* Second Text to Copy in Cycle Clipboard Ring */

SELECT 
    NAME
   ,COMPATIBILITY_LEVEL
   ,STATE_DESC
   ,RECOVERY_MODEL_DESC
FROM SYS.DATABASES
GO 

/* Third Text to Copy in Cycle Clipboard Ring */

SELECT * FROM sys.procedures
GO

in ssms copy and paste the t-sql code in a new query window

3. Go ahead and Cut / Copy each set of TSQL Code from the above example one by one. Remember, the last item which you have cut or copied into the Clipboard Ring will be the current item for pasting.

4. Open a new query window and use Crtl+Shift+V to paste the Cycle Clipboard Ring's current item to the current query window.

5. Repeatedly press Crtl+Shift+V to cycle through each entry within the Clipboard Ring until you find the one you would like to paste in the query window. Each time you press Crtl+Shift+V within SQL Server Management Studio it replaces the last entry you pasted from the Cycle Clipboard Ring with the one new one which you have copied / cut earlier.

Next Steps



Get Started Now - Click here to get your free 14 day trial of SolarWinds Database Insights




get scripts

next tip button



About the author
MSSQLTips author Ashish Kumar Mehta Ashish Kumar Mehta has been contributing to the MSSQLTips.com community since 2009 with over 60 tips.

View all my tips


Article Last Updated: 2022-02-18

Comments For This Article





download














get free sql tips
agree to terms