Is there a way to seach for info within a cell that is in the query result.

noamco36
noamco36 used Ask the Experts™
on
Using SQL server 2008, when I run a SELECT query that spits a result set, is there a way to "seach" for a particular cell within the result?

When I try to use the Ctrl+F, it searches only within the query  window, but not in the result set.

Also, how to you toggle between multiple query windows?

Thanks you.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
Normally you use the WHERE clause of the query to search for specific values.

Personally I use one tab per query when I want to toggle between results and seldomly execute multiple queries in a New Query tab.

Finally you can select all data (CTRL+A) , copy the data (CTRL+C) and paste it (when less than 65.000 rows) into an excel worksheet. There the AutoFilter can come in handy sometimes to see all different values and filter multiple rows.

Author

Commented:
Selecting all data (CTRL+A) , copy the data (CTRL+C) and paste it into an excel worksheet works fine, but its too cumbesome...

My question is: Is there a way "WITHIN" SSMS to search from specific cells?
 

And, your answer regarding the toggeing issue prompted me to  look it up, and I found CTRL+F6 to do the trick.


My question is: Is there a way "WITHIN" SSMS to search from specific cells?
Commented:
Don't have experience with SSMS yet, I use the SQL Server Management Studio to handle queries directly on the dtabase and thus my "tab" remark, as each New Query will open a new tab.

Author

Commented:
ok, the Query tab issue is soleved.

what about:
Selecting all data (CTRL+A) , copy the data (CTRL+C) and paste it into an excel worksheet works fine, but its too cumbesome...

My question is: Is there a way "WITHIN" SSMS to search from specific cells?
Commented:
I wasn't aware about the SSMS, but I would advise to change the question title to include SSMS or open a new question with SSMS in the title to attract SSMS experts.
Top Expert 2012
Commented:
ggzfab,

Don't have experience with SSMS yet, I use the SQL Server Management Studio to handle queries directly on the dtabase
There seems to be some confusion here:
SSMS = SQL Server Management Studio
Top Expert 2012
Commented:
My question is: Is there a way "WITHIN" SSMS to search from specific cells?
1. Change to "Results to Text"
2. Execute the query
3. Change to the Results window.
4. Ctrl-F to find text in the output.
Commented:
Oops, thought it was another module like SSAS or SSRS.

Author

Commented:
acperkins:
That is a good start.
I followed the article in : http://www.mssqltips.com/sqlservertip/2346/different-options-for-query-results-in-sql-server-management-studio/

and changed to "Results to Text".
The article mentions that the changes will go into effect once you open a New Query window.
This did not happen, as I still get Grid results.
I then tried to close and re-open SSMS and the results are still in Grid output.
(I made sure the settings are still "Results to Text" ).

Am I missing something?
Commented:
For me it does work when the combobox is set to "Results to Text" For the menu option "Query Results" + "SQL Server" +  "General".

I personally only set the "Include column headers ..." option to true.

Author

Commented:
I just checked the "Include column headers" and the box is checked.
took out the other boxes, still getting Grid results.

I posted a comment on the article itself, hopefully the author of someone can answer.

Do you know if there is any other way to do the trick?
Commented:
Don't know another way, but are you sure that under  "Query Results" + "SQL Server" +  "General" the combobox is set to "Results to Text" ?
On the other hand, as both (grid and text) are displayed it's only clicking on the other tab above the results to switch.

Author

Commented:
see attached.
RTtext.docx
Top Expert 2012
Commented:
I thought this was simple, so let me try and give you more detail (there is no need to restart SSMS):
1. Select the Query menu.
2. Click on "Results To"
3. Select  "Results to Text"

Or simply look for the "Results to Text" icon on the Toolbar.

Finally execute your query.

As long as you keep that window open it will continue to output as text.

Commented:
Can't explain why it's  not working when I see your document. Could be a bug in MMSM, so you could try to repair the application from the software menu in the configuration section.

Author

Commented:
acperkins:

This worked

1. Select the Query menu.
2. Click on "Results To"
3. Select  "Results to Text"

Or simply look for the "Results to Text" icon on the Toolbar.

Finally execute your query.

As long as you keep that window open it will continue to output as text.



Thanks!

But isn't the article ( http://www.mssqltips.com/sqlservertip/2346/different-options-for-query-results-in-sql-server-management-studio/
) talking about the same thing, only in a way to keep the "Results to Text" as a default?

Either there is a bug in SSMS (as ggzfab suggested), or I did not read the article correct?
Commented:
I would try the repair option in the controls section, or just use the click on the tab of the text output.
Personally I still prefer the grid as it's more flexible in narrowing large text columns so other columns to the right are made visible.

Author

Commented:
That makes sense , issue solved.
Thanks!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial