How to apply template parameters in SQL Server 2005

Source: Internet
Author: User
Tags key sql query management studio sql server management sql server management studio

If you build functions or stored procedures with SQL Server Management Studio, you'll notice that these new windows are all templates. Usually, you can get a frame that is strewn with markers.

List A is an instance that is established by expanding the programmable node in the Object Browser (Object Explorer), selecting the stored procedure, then right-clicking and selecting the new stored procedure.

The number of developers who fail to read the first piece of information on how to fill in the parameters is surprising. To do this, you can press the key combination [ctrl][shift]m or select a query from the main menu | Specify template parameter values (query | Specify Values for Template Parameters). Whichever method you use, the dialog box shown in Figure 1 appears.

Follow these steps to assign a value to any one of the template tags.

Double-click the corresponding row in the dialog box.

Enter an appropriate value and continue until you have completed all the assignments.

Press the OK key.

The dialog disappears, and as with magic, the tag is replaced by the value you provide.

The above template assumes that you submitted two parameters to the stored procedure. Before opening this dialog, it's obvious that you can't use this template. For example, before opening the dialog box, I added a third parameter to the template code. Therefore, the dialog box automatically assigns a value to this new parameter. Figure 2 illustrates the differences between them.

It's a bit of a hassle to perform, but it's a very flexible feature. If you open the Parameter dialog box and press OK, any tag that you do not have an updated feature will no longer be labeled even if it is not garbage.

This little problem should not prevent you from using this feature of the editor. Just remember to adjust the template code before you open the Parameters dialog box. In this way, each object you build will get a formatted standard file header that is consistent with the objects in your database.



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.