Solved

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

Posted on 2010-08-30
3
878 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 250 total points
ID: 33562968
There is no other way through SSMS.
0
 
LVL 5

Assisted Solution

by:spikelly
spikelly earned 250 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

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to SQL Trace a SPECIFIC query 24 59
Installing SQL Server Express Management Studio 4 23
SQL Exceptions 3 40
sql Total query 2 18
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

863 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

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now