The forum will be unavailable for maintenance at some point from Friday, April 13 at 19:00 EDT until Sunday, April 15 at 23:59 EDT. Downtime will be minimized but the exact timing is unknown.

Is there way to disable all db events when running a db engine? I like to start an engine with a database to validate and would not like any events to be run.

asked 09 Dec '13, 19:50

Tuan%20Dinh's gravatar image

Tuan Dinh
accept rate: 0%

I don't think there's a builtin facility to do so, cf. this (older) thread:

How to avoid execution of DatabaseStart Event

What we have done to disable events for databases that are non running in "normal mode":

  • When starting the database, run a script with some ALTER EVENT statements to disable the according events
  • Modify the event handlers to check for some configuration (say, the name of the database engine or the database or the machine name) and to behave accordingly (say, to skip the event's code or to choose a different backup location for production and test environments... - a worthwhile difference:))

Obviously one could combine both methods in a DatabaseStart event that would automatically prevent events when not running in the "normal environment".

If you are about to suggest a command line parameter to skip all event execution, I guess I'd second that:)

permanent link

answered 10 Dec '13, 03:43

Volker%20Barth's gravatar image

Volker Barth
accept rate: 32%

You could start the database read only, so that the events cannot change it, if this is what you would like to prevent: Use command line parameter -r

permanent link

answered 10 Dec '13, 07:23

Martin's gravatar image

accept rate: 14%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 09 Dec '13, 19:50

question was seen: 739 times

last updated: 10 Dec '13, 07:23