Templates for New Query Window

When I’m in SQL Server Management Studio and I click the “New Query” button, my Query Window comes up like this:

/* <ScriptFileName, SYSNAME, ScriptFileName>.sql

Purpose: <Purpose, SYSNAME, Purpose>

Author: <Author, SYSNAME, Buck Woody>

Last Edited: <LastEdited, SYSNAME, LastEdited>

Instructions: <Instructions, SYSNAME, Instructions>

References:

*/

/* End <ScriptFileName, SYSNAME, ScriptFileName>.sql */

Then I just press CTRL-SHIFT-M and enter the name of the script file, the purpose and so on.

I was recently asked how I have that come up every time.

Just locate the file called Sqlfile.SQL. It’s normally in:

C:\Program Files\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\SqlWorkbenchProjectItems\Sql

And edit it to have whatever you want. If you want the replaceable parameters like I have, just put whatever you want in this format:

<ParameterName, ParameterType, DefaultValue>