question

Jasperjaz avatar image
Jasperjaz asked

How to Save Query Options

In SQL Server 2012, I want to save the Query Options I set for a session. These are set in SSMS in Query > Query Options. Example: Results to Grid. There used to be a way to save these so you don't have to set them for every session, but I can't find it in 2012.
sql-server-2012query-resultsresults
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Grant Fritchey avatar image
Grant Fritchey answered
Sure thing. Go to "Tools" "Options" and then down to "Query Results" In the "General" tab you can decide if you want results to grid, text, or file. You can also go to the "Results to Grid" to set other options about the grid behavior. Also, you can go to "Query Execution", "SQL Server" and "Advanced" to turn on SET STATISTICS TIME or SET STATISTICS IO to on for all query windows. Neither of these will work for an existing query window. But close it and reopen it and you'll get what you need.
2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Yes. I'm familiar with how to set these. The problem is that these settings don't persist for subsequent SSMS sessions. If I close SSMS down, when I re-open it and run a query, the settings are back to their defaults. Any way to make them persist?
0 Likes 0 ·
This is how I do it. It always persists.
0 Likes 0 ·
Jasperjaz avatar image
Jasperjaz answered
I tried this again and it does work for me. Thanks so much for your answer and your graciousness.
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.