Solved

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

Posted on 2010-08-30
3
877 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Long way back, we had to take help from third party tools in order to encrypt and decrypt data.  Gradually Microsoft understood the need for this feature and started to implement it by building functionality into SQL Server. Finally, with SQL 2008, …
Introduction: When running hybrid database environments, you often need to query some data from a remote db of any type, while being connected to your MS SQL Server database. Problems start when you try to combine that with some "user input" pass…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

757 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

22 Experts available now in Live!

Get 1:1 Help Now