Restoring the default stored procedure and trigger templates

  • Hi.

    I've accidently overwritten the stored procedure template on one of our SQL Servers (v7). The trigger template had been overwritten allready by someone else. Apparently I've clicked the "save as template" button and then answered yes to overwrite the default. I have no idea how that happened, but there you go.

    Now the problem is that the default templates have this nice feature where they automagically fill in the name of the table on which you're creating the trigger. (This is in Enterprise manager, not in Query Analyzer.) We have another SQL Server that is still untainted, but when I try to copy/paste the trigger template from there, it just copies the code literally: the table name doesn't change when a new trigger is created.

    Apparently the default templates have some hidden code behind them to get the tablename for the current table. I've looked high and dry for this magic code, but it is nowhere to be found. Does it exist somewhere, or is it just a figment of my imagination ? (Doesnt't seem likely, as the other server is still strong in its magic.) I could copy the hidden code from the other server, if I only knew where to find it.

    Any ideas ?

    Thanks in advance.

    uXs

  • Kris - look for .tql extension files on the local drive (local to sql server ie...) - they're normally to be found under the "...\Tools\Templates\SQL Query Analyzer.." folder...

    It sounds like they were using the "create procedure" template from here...read up BOL on how to use the template to replace the template parameters with your own!!!







    **ASCII stupid question, get a stupid ANSI !!!**

Viewing 2 posts - 1 through 2 (of 2 total)

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