161

This happens intermittently and seems to be related to accidentally hitting a key.

Any ideas what causes this?

3 Answers 3

296

It sounds like you have accidentally changed from the default query option of "Results to Grid" to "Results to File". If that is the case it is easy to fix:

From the Query Menu -> Results To -> Results To Grid.

OR

Press Ctrl + D

Once you have tried one of the steps above, run your query again by pressing F5.

2
  • 78
    Ah ha! ctrl + shift + F (which is global search in VS2008) puts me in that mode. Thanks! Aug 4, 2009 at 14:43
  • 2
    The command to switch to "Results to Grid" is Ctrl + Shift + D (at least for for SSMS 2016)
    – Robino
    Jun 17, 2016 at 13:06
36

Previous answer didn't apply to me. My query results were set to grid already (CTRL+D).

The issue is, if you're using a Microsoft ergo keyboard and the function lock (key to the right of F12 usually) is not on, then F5 will bring up an open file dialog by default.

So, yet another embarrassing resolution is: Keep F lock on! :)

On many laptops, there is no dedicated key for this, but often there is a keypress that will be equivalent, such as for dell laptops: Fn+Esc or the All in One Media Keyboard:Fn+Caps Lock

0
0

You can also get stuck in this mode (like I did) by accidentally pushing the "Results to File" button in the toolbar in SSMS. Click the "Results to Text" or "Results to Grid" as desired and you'll be back to your usual, expected behavior.

enter image description here

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

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

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