Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

How to Script all Triggers from DB into Text File? Expand / Collapse
Author
Message
Posted Thursday, August 12, 2010 5:38 AM


SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Friday, June 24, 2016 12:43 AM
Points: 235, Visits: 1,281

How to script triggers only and getting output in text files as same as SSMS Script Wizard, specially w.r.t SQL Server 2005 and 2008.

Post #968083
Posted Thursday, August 12, 2010 7:52 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: 2 days ago @ 2:41 PM
Points: 2,492, Visits: 8,401
http://www.sqlservercentral.com/scripts/Maintenance+and+Management/30222/


Forever trying to learn

For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/

For better, quicker answers on SQL Server performance related questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/



If you litter your database queries with nolock query hints, are you aware of the side effects?
Try reading a few of these links...

(*) Missing rows with nolock
(*) Allocation order scans with nolock
(*) Consistency issues with nolock
(*) Transient Corruption Errors in SQL Server error log caused by nolock
(*) Dirty reads, read errors, reading rows twice and missing rows with nolock


Craig Wilkinson - Software Engineer
LinkedIn
Post #968194
Posted Thursday, August 12, 2010 10:43 PM


SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Friday, June 24, 2016 12:43 AM
Points: 235, Visits: 1,281


Thank you for your time,

but i had gone through this solution before but .... !


My scheme would be to replace this old technique, as we can easily get definition of trigger by new methods into a table/variable and then by just using any useful/simple technique to write contents of that table/variable to a simple text file.

Do you can assist? Please!



Post #968649
Posted Friday, November 20, 2015 4:45 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, July 11, 2016 4:45 AM
Points: 8, Visits: 129
Did you got any script which will generate all triggers in separate files. I have 781 triggers to be scripted out. The solution given in link does not create separate files for each trigger.
Post #1738563
Posted Monday, November 23, 2015 7:03 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: 2 days ago @ 12:22 PM
Points: 7,326, Visits: 8,481
Jagdev, post a new thread and detail your issue a little more.

People don't tend to respond to older threads.


Brandie Tarvin, MCITP Database Administrator

LiveJournal Blog: http://brandietarvin.livejournal.com/
On LinkedIn!, Google+, and Twitter.

Freelance Writer: Shadowrun
Latchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.
Post #1739233
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse