0

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!!

3
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, privacy policy and cookie policy

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