Query Analyzer Template Question

  • This may be a real bonehead question... but when I use a Create Procedure template in Query Analyzer I get a structure that contains a delimited set of info for the Create Proc and Drop Proc commands that looks like this...  "CREATE PROCEDURE <procedure_name, sysname, proc_test> "

    What are the 'sysname' and 'proc_test' placeholders for?

    Normally I just use the name of Proc...

    I have read BOL for Create Proc and Drop Proc and there aren't any examples that jump out on this...

     

     

  • Hi Steve...

    I am sorry, but I don't see an answer to my question in your article.

    I had actually read your article earlier (before I posted this).

    Can you elaborate...

    The template has a line

    "CREATE PROCEDURE <procedure_name, sysname, proc_test> "

    What are the 'sysname' and 'proc_test' placeholders for?

  • It looks like they are XML values that the Query Analyzer looks for when doing the "Replace Template Parameters" dialog box. My guess is that Query Analyzer looks at these and then knows what type of values to allow to be used. I've never used this functionality before as I just write my own from scratch!

     

    EDIT: I just found the following in BOL... DOH

     

    The template scripts provided with SQL Query Analyzer contain parameters to help you customize the code. Template parameter definitions use this format:

    <parameter_name, data_type, value>

    where

    • parameter_name is the name of the parameter in the script.
    • data_type is the data type of the parameter.
    • value is the value that is to replace every occurrence of the parameter in the script.

    Use the Replace Template Parameters dialog box to insert values into the script.

    Note  You can use the Replace Template Parameters dialog box to specify values any time a parameter definition is used in code. For example, when you execute a function from Object Browser, the function that is written to the Editor pane contains parameter definitions for any arguments in the function. You can, therefore, use the Replace Template Parameters dialog box to specify argument values.




    Gary Johnson
    Microsoft Natural Language Group
    DBA, Sr. DB Engineer

    This posting is provided "AS IS" with no warranties, and confers no rights. The opinions expressed in this post are my own and may not reflect that of my employer.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply