Default query in SSMS window
- Adam Thurgar
- Sep 18, 2019
- 1 min read
I have a query that I run against a number of servers when doing weekly checks. Now I could run a single query against the local group I have created in the registered servers, but the output is then just one large chunk and I prefer looking at the results on a server by server basis. So what I needed was a default query to populate when I opened a query window. What I found was that you just need to put that query (or other text) into a file called SQLFile.sql.
The location of this file will vary according to your installation, but an example is:
C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\SqlWorkbenchProjectItems\Sql\SQLFile.sql
Now there is less typing when I do the weekly checks.

Comments