title: How to Generate Scripts For All Triggers in Database Using Microsoft SQL Server Management Studio
body: <p>I'd like to generate an SQL Script that contains the SQL to create all of the triggers that exist in our database.  The triggers were added directly via the SSMS query pane so, there is currently no source other than the trigger on the database itself.  </p>
  
  <p>I have already tried the method where you right-click the database, select <code>Tasks-&gt;Generate Scripts</code> and used the "Script Entire Database and All Objects" option.  While this does create a SQL script for the tables and constraints, it does not generate SQL for the triggers.  </p>
  
  <p>I also understand that I can right click on each trigger in the database and select the Generate SQL Script option but, there is currently 46 tables under audit (For Insert, Update, and Delete).  </p>
  
  <p>Rather manually generate an insert, update, and delete trigger script for each of the 46 tables, is there an easier way to do this?  Or, should I start clicking, copying, and pasting?</p>