• Adam Thurgar

Default query in SSMS window

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.


Recent Posts

See All

Cardinality estimator

Recently I was asked by a software vendor to review a particular query that ran in under a second on a SQL Server 2014 installation at a compatibility level of 110 (SQL Server 2012), but when run unde

Index fragmentation

A law firm client, occasionally has issues with their legal software, that is provided by the global leader in this field. The response from the software provider is always the same - you have index f

Deleting large amounts of data

I had a client call me about wanting to delete a large amount of data from their database. They knew what tables they wanted to delete from. They also knew that deleting large amounts of data causes t