How many objects/features you have in SQL Server? It will range from simple Table, View to CDC, Encryption.
Let us says that you were asked to create a server trigger. Do note that DDL triggers do not have a user interface support in SQL Server Management Studio. (In case you do not know about DDL triggers doest matter. We will discuss about in a later day).
Since these are not heavily use objects, we will not remember this by heart. So, how to get the template for these types of objects?
In the view, there is an option called Template Explorer.
Following is the Template Explorer.
You can see that you will see almost all the objects that you can create in the SQL Server. When you double click the Create Database Trigger following script will be seen in SSMS.
-- Create database trigger template
USE <database_name, sysname, AdventureWorks>
WHERE name = N'<trigger_name, sysname, table_alter_drop_safety>'
AND parent_class_desc = N'DATABASE'
DROP TRIGGER <trigger_name, sysname, table_alter_drop_safety> ON DATABASE
CREATE TRIGGER <trigger_name, sysname, table_alter_drop_safety> ON DATABASE
FOR <data_definition_statements, , DROP_TABLE, ALTER_TABLE>
IF IS_MEMBER ('db_owner') = 0
PRINT 'You must ask your DBA to drop or alter tables!'
So you have the temple to edit. Hold on, there is an easy way to edit this.
Press Ctrl+Shift+M together.
You can enter all the parameters in this dialog and it will update your script accordingly.
Template Explorer has templates for Analysis Service and SQL Server Compact edition as well.
Also, you have the option of adding new templates. Most organizations have different standards. For example, you may have different standard for writing SQL Server procedures. You can create a template for that and include it to your SSMS.