tags:

views:

179

answers:

3

Is it possible to change the default templates in SQL Server Management Studio? For example, when I right-click on a table and I choose "Script Table as" from the context menu, I can choose select, insert, update, etc. I would like to change the format of some of these sql scripts like you can with the templates in the template explorer.

+2  A: 

'Tis possible only in Tools -> Options -> SQL Server Object Explorer -> Scripting

silent
I was hoping for a way to modify the format in other ways such as indentation.
Daniel
I think it is not possible to change something else.
silent
A: 

If you are looking to do DROP and CREATE statements in the same script, or otherwise generate scripts for SQL Server 2005 that are more compatible with SQL Server 2000 scripts, you mey want to check out the Scriptio tool:

http://www.codeplex.com/scriptio/

RMorrisey
A: 

For more control than tools -> options, apparently there are bunch of templates that you can change in the application directory (i.e. : C:\Program Files\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\sqlworkbenchprojectitems\Sql), however I couldn't find the ones for basic DML (INSERT, UPDATE etc).

Maybe just the ones for creating new objects are available.

Serkan
These templates are exactly the kind of thing I want to have access to. However, these are the templates used by the template explorer and don't include the basic SELECT, INSERT, UPDATE, etc. templates.
Daniel