Solved

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

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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

INTRODUCTION: While tying your database objects into builds and your enterprise source control system takes a third-party product (like Visual Studio Database Edition or Red-Gate's SQL Source Control), you can achieve some protection using a sing…
In this article I will describe the Detach & Attach 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.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

770 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