?
Solved

How to Script Only the triggers in a SQL 2008 database?

Posted on 2010-08-30
3
Medium Priority
?
891 Views
Last Modified: 2012-06-21
I found this script to script just the triggers from a sql 2008 database: http://www.sqlservercentral.com/scripts/Maintenance+and+Management/30222/. Is that the only way to do it? Did MS really not give you a way to do it from SSMS without including the table definitions as well? I can't believe that since you would have to delete a table's data just to change how its triggers work.

Hopefully, there's a way to do this from SSMS. Otherwise, I'll see if my copy of ApexSQL will do the trick.

Thanks in advance.
0
Comment
Question by:ZekeLA
3 Comments
 
LVL 8

Accepted Solution

by:
avirups earned 1000 total points
ID: 33562968
There is no other way through SSMS.
0
 
LVL 5

Assisted Solution

by:spikelly
spikelly earned 1000 total points
ID: 33566920
No way through SSMS. Check with your APEXSQL which will help you achieve this by generating a Documentation; you can try SQLDoc from Redgate.Com as well, all are great SQL tools.

0
 
LVL 19

Expert Comment

by:Bhavesh Shah
ID: 33567364
Hi Author,

SSMS is not provide any tool.but you can do achieve via query.



SELECT tl.name [Table Name],TR.Name [Trigger Name] ,EV.Type_Desc [Trigger Event],
c1.text
from sys.TRIGGERS tr
inner join sys.trigger_events ev on tr.object_id=ev.object_id
inner join SYS.OBJECTS tl on tl.object_id=tr.parent_id
INNER JOIN syscomments C1 ON tr.object_id=c1.id
order by tl.name

Open in new window

0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

by Mark Wills Attending one of Rob Farley's seminars the other day, I heard the phrase "The Accidental DBA" and fell in love with it. It got me thinking about the plight of the newcomer to SQL Server...  So if you are the accidental DBA, or, simp…
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Loops Section Overview
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question