Generate sql script of triggers SQL Server 2000

  • Hi !!!

    I want generate sql script with all triggers of a database in Enterprise Manager, but i don´t tables in script.

    I want only all triggers.

    Is possible ?

    P.s. In SQL Server 6.5 was possible !

    Thanks .

    Adriana

  • Dont think so, you can do it from Query Analyzer.

    Andy

    http://www.sqlservercentral.com/columnists/awarren/

  • For some reason this was removed in EM in 7 and 2000 (may want to make a request to MS for this option). Now as for what Andy stated you need to use the sysobjects table and syscomments table to get the name and text based on being a trigger similar to so.

    SELECT [name], [text] FROM sysobjects obj INNER JOIN syscomments com ON com.[id] = obj.[id] WHERE xtype IN ('TR')

    "Don't roll your eyes at me. I will tape them in place." (Teacher on Boston Public)

  • You can actually script out the trigger directly by using the Object Browser to locate it, right click, script as create, alter, etc

    Andy

    http://www.sqlservercentral.com/columnists/awarren/

  • quote:


    For some reason this was removed in EM in 7 and 2000 (may want to make a request to MS for this option). Now as for what Andy stated you need to use the sysobjects table and syscomments table to get the name and text based on being a trigger similar to so.

    SELECT [name], [text] FROM sysobjects obj INNER JOIN syscomments com ON com.[id] = obj.[id] WHERE xtype IN ('TR')

    "Don't roll your eyes at me. I will tape them in place." (Teacher on Boston Public)


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

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