Hi Friends,
Whenever I click on ‘New Query’ in SQL Server Management Studio, I get the New Query Window, but a customized one. See below:
You can see that “Copyright 2011 – Amit Bansal’ comes by default whenever I click on New Query. In a recent conference, one of the attendees observed this and asked me how can he customize the new query window. Well here is the trick:
Modify SQLFile.sql which is located in C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\SqlWorkbenchProjectItems\Sql. And you are done. This path is for 64 bit installations. Just remove the (x86) for 32-bit installations. Or search for the file 😉
Edit the file in any editor (I use Notepad, my fav editor), put any default comment that you want to be there whenever you create a New Query. And you are done !
Cool tip! Simple yet extravagant!
Good one amit. 🙂
handy trick…. thanks Amit.
Good to see many of you liking these tips.. I shall try to post more such tricks/tips. Thanks agin for reading our content at sqlservergeeks.com
Cheers !
Gud One Amit.
I was not aware of this.
Cool one! Thanks and looking forward for more tips like this.
thanks amit I was copy WHOLE HEADER and automate as per your suggession
hi . nice.
but i want 3 line code and my cursor should at last new line.
how can i do it.
let me know.
thank in advanced
Just wanted to say thank you for this – has been invaluable for almost a year. I put my most commonly used tables together in a select, all commented out. Huge shortcut.
Hi,
I am junior sql dba with one year experince, could you please help me?
when we opene ssms it gives a connection string and we press connect it gets connect, could you help me how it gets connected, is there any file it is checking, or any protocol it is using to check, could you please explain me in detail what exactly is happening when we press connect?
Regards,
Adi
Great tip! Is there a way to do this with SQL Server Studio Manager 2012?
Thanks,
Lee
Lee, in SQL Server 2012, this file is at C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\SqlWorkbenchProjectItems\Sql. Enjoy, thanks.
This works for the New Query button on the toolbar, but if I right-click on a database and choose New Query from the context menu, I still get an empty single line file. Can you say how to customize this way to a new query rather than the toolbar button? Thanks.