There has to be a better way!

When writing a subquery code I need all the rows listed from a table so I can manipulate what I want grouped/summed/etc. The only way I have found to do this is to find that table in the SQL Object Explorer, right click, and hit 'Select Top 1000 Rows', then copying and pasting into my subquery.

Isn't there a shortcut or something so I don't have to get out of my query to do that? Why can't I select the table and right click or something.

Please someone tell me there is a better way!!

  • I'm pretty sure there is, but it's not super clear what you are trying to do. Could you please add a concrete example of what you do to help us helping you. Thanks Jul 23, 2021 at 15:49
  • 2
    Something like this? Jul 23, 2021 at 15:54
  • 1
    Maybe a T-SQL code snippet?
    – Dan Guzman
    Jul 23, 2021 at 16:34

1 Answer 1


Most objects in SSMS's Object Explorer are drag and dropable directly into the Query Editor tab you're currently in.

For example, if you hold left-click, and drag the name of the table you want, you can drop it on any line of code in your active Query Editor tab.

Furthermore, I use this as a quick way to list out all of the columns of an entity in my query without having to do manual work, by drag and dropping the "columns" folder beneath an entity into my Query Editor tab.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.