sql server - SQL dependency event fires on Alter Database but not on Table changes -


working on else's code they've instituted sql dependency event (sql 2008). not i'm terribly familiar doing reading , testing.

the event called customerservicestable_onchange , presumably meant fire whenever customerservices table changed. when db changed through code (we're using entity framework) event not firing.

out of curiosity fired sql server manager , tried running queries against table directly see happen. running update, insert or alter queries against table didn't cause event fire.

to check sql dependency had been enabled ran following commands against database, supposedly first step in enabling service:

alter database customers set single_user rollback immediate alter database customers set enable_broker alter database customers set multi_user 

to surprise running these commands caused event fire!

so looks though dependency working against either database whole, or table(s) in db other customerservices. can suggest way forward me determine problem is?

edit: have discovered it's not alter database commands causing event fire, fact set single_user causes error. doesn't me problem though.

cheers, matt

read first understand how sqldependency works: the mysterious notification.

possibly notifications piling in sys.transmission_queue , transmission_status indicate why happens.

a shot in dark: dbo mapped invalid sid:

alter authorization on database::customers sa; 

Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -