Auto Comment your SQL Script

Leave a comment (0) Go to comments

How can I comment my SQL Script automatically ?

One of my friend is working as SQL Developer (DBD) and 80% of the time he just create database objects and write stored procedures.

As per the company policy, every code (SQL Script), should have a standard comment like

Auto Comment your SQL Script SQLFile.sql customized New Query Window auto comment your sql code

So every time, he has to copy this code from a file and paste in new query window. It’s looks pretty easy but when you wanted to make this as a practice, you might wanted to have some sort of template so that you can avoid this step.

So here is the Trick / solution, recently shared by a great technical resource Amit. He is really a good presenter.

Solution

Modify SQLFile.sql which is located in "C:\Program Files\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\SqlWorkbenchProjectItems\Sql", using any editor like notepad, add your own comments what you want to see every time, when you hit a New Query button. Save this file and you are done.


Auto Comment your SQL Script SQLFile.sql customized New Query Window auto comment your sql code

EOF - Auto Comment your SQL Script, SQL Server 2012 , 2008 R2 , 2008 , 2005 , 2000

Leave a Reply

Your email address will not be published. Required fields are marked *


*


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Notify me of followup comments via e-mail. You can also subscribe without commenting.