-2

I created some triggers in SQL Server 2012.

Now I create a Generate scripts but I can not see triggers after publish

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
taraz
  • 3
  • 3
  • 1
    When you generated the script - did you choose to **include** the triggers? $ – marc_s Nov 04 '14 at 20:00
  • possible duplicate of [How to Generate Scripts For All Triggers in Database Using Microsoft SQL Server Management Studio](http://stackoverflow.com/questions/13200511/how-to-generate-scripts-for-all-triggers-in-database-using-microsoft-sql-server) – Tab Alleman Nov 04 '14 at 20:03

2 Answers2

1

If you used Management Studio to generate your scripts, then you likely didn't set the option to include triggers on script generation.

Look under Tools -> Options -> SQL Server Object Explorer -> Scripting -> Script Triggers

See http://msdn.microsoft.com/en-us/library/bb326600.aspx for reference and default values.

Ryan Nigro
  • 4,389
  • 2
  • 17
  • 23
0

The triggers are not scripted by default - you have to include them specifically!

On the Generate and Publish Scripts dialog, you need to click on the Advanced button and in the dialog that pops up, you need to select Script triggers and set it to TRUE (it's FALSE by default):

enter image description here

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459