Click here to Skip to main content
15,868,043 members
Articles / Database Development / SQL Server
Tip/Trick

SQL Server Template Explorer

Rate me:
Please Sign up or sign in to vote.
5.00/5 (7 votes)
25 Nov 2010CPOL1 min read 19.6K   3   6
How do you use the Template explorer and assign parameter values.
Do you feel tired of knowing or searching for the syntax of doing some tasks like creating database, adding a constraint to a table etc.,?

SQL 2005 provides lots of template of doing basic tasks. This tip is for people who do not know about template explorer.

Let me provide this TIP with a small example of creating a database (Database only) called Inventory.

01) Launch the SQL Server 2005 Management studio
02) Click on Menu Item View=>Template Explorer (Or Ctrl+Alt+T)
03) This will open the Template Explorer on the left or right side pane
04) Have a look at the almost for all the tasks there is a template.
05) For our example, expand the Database folder
06) Double click the create database node
07) Provide the authentication in the displayed dialog to connect to the db
08) You have a template code in the Query Editor Window.
09) Now you need to fill the parameters for the Template before running the Query
10) Look for the Toolbar Icon A=>B, the Tool tip says, "Specify values for template Parameters". And click on it.
11) The displayed dialog shows all the Template parameter required. Fill in the Value for the database name. Click OK.
12) Have look at the Query in the query editor window. It is now ready to create the database. Execute the Query to finish the task of creating the database.

I have taken a very simple template for this tip. But can try with some other templates. I think this TIP will minimize going web search for the syntax of performing the basic tasks. Please try with Someother Template Options.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer iSOFT
India India
I am working as software engineer in iSOFT R&D. I have been come across C++,MFC, .net technologies. I do like playing video games, reading books.

Web: www.mstecharticles.com


Comments and Discussions

 
GeneralThank you Abdul Pin
Sivaraman Dhamodharan25-Dec-10 18:01
Sivaraman Dhamodharan25-Dec-10 18:01 
GeneralReason for my vote of 5 Good work! Pin
Abdul Quader Mamun17-Dec-10 5:29
Abdul Quader Mamun17-Dec-10 5:29 
GeneralThanks CIDev and Iqbal. Pin
Sivaraman Dhamodharan25-Nov-10 23:55
Sivaraman Dhamodharan25-Nov-10 23:55 
GeneralReason for my vote of 5 A handy little tip Pin
BillW3322-Nov-10 14:21
professionalBillW3322-Nov-10 14:21 
GeneralReason for my vote of 2 Doesn't really contain anything new ... Pin
Marc Scheuner19-Nov-10 1:11
professionalMarc Scheuner19-Nov-10 1:11 
GeneralReason for my vote of 5 Thanks for sharing Pin
Shahriar Iqbal Chowdhury/Galib17-Nov-10 21:12
professionalShahriar Iqbal Chowdhury/Galib17-Nov-10 21:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.