How to use Templates in SQL Server Management Studio (SSMS) - SQL Server / TSQL Tutorial Part 16

Scenario:

I am new developer or been working from long time but my memory is not that great;) every time I need to create an object, I forget the script and I have to go to Google or Microsoft website to get the  template for create, alter object. Does SSMS has something like that so I can use that?


Solution:

SQL Server Management Studio does have built-in templates and you can use them whenever you need them.

Here are the steps how to use Built-in Templates in SSMS.

Step 1:

Go to View Drop down and then choose Template Explorer
How to use Templates in SSMS - SQL Server Tutorial

Template Explorer will open and you will see a lot of templates as you can see some of them in below snapshot.
How to use built-in Templates in SSMS - SQL Server Tutorial Step by Step



Step 2:
Double click on template you would like to use. I clicked on Create Table and below window opened.
How to use Templates in SQL Server Management Studio- SQL Server Training


Step 3:

Now we can replace the existing values in template and change as we like. To provide the values for Template Parameters, Go to Query and then hit Specify Values for Template Parameter as shown below.

How to use Template in SSMS to create Table - SQL Server Tutorial for Beginners

Step 4:

Final step is to provide the values. Once you click Specify Values for Template Parameter, Below windows will open. Go ahead and make changes as per your requirement.

How to use built-in Templates in SSMS - SQL Server/TSQL Tutorial


After providing different parameter values, once you hit Ok. Your query will be ready. I only made change for Database name and Table Name, here is what I get after I hit Ok.


How to Use Templates in SQL Server Management Studio - SQL Server Tutorial

6 comments:

  1. My partner and i still can not quite assume that I could be one of those reading through the important recommendations found on this blog. My family and I are sincerely thankful for your generosity and for presenting me potential to pursue the chosen career path. Appreciate your sharing the important information I acquired from your web-site. macbook template

    ReplyDelete
  2. This article gives the light in which we can observe the reality. This is very nice one and gives in-depth information. Thanks for this nice article. device mockups

    ReplyDelete
  3. I think this web site has very superb composed subject material articles . ipad mockup

    ReplyDelete
  4. There are some fascinating points in time in this article however I don’t know if I see all of them middle to heart. There’s some validity but I will take maintain opinion till I look into it further. Good article , thanks and we would like extra! Added to FeedBurner as nicely website design company san francisco

    ReplyDelete
  5. fertility clinics these days are very advanced and of course this can only mean higher success rates on birth’ website design company san francisco

    ReplyDelete
  6. Wow that grow to be unusual. I surely wrote an extremely prolonged remark but when I clicked placed up my announcement didn’t show up. Grrrr… well I’m now not writing all that once more. Anyways, really wanted to mention excellent blog!

    ReplyDelete