Thursday, March 8, 2012

DB Owner & SqlDependency Problem

I deleted the account owning Test Database after creating Test Database.

Everythings work well except SqlDependency.

SqlDependency OnChange Event is not working.

I have tested SQL 2005 ent RTM & VS 2005 Pro RTM.

I'm curious why it happened.

Thank you.

SqlDependency needs the EXECUTE AS infrastructure to do it's work. If the account that created the database was deleted, EXECUTE AS user 'dbo' will fail, because it cannot retrieve the account info. Change the database ownership to a valid account:

ALTER AUTHORIZATION ON DATABASE::[Test Database] TO [sa];

HTH,
~ Remus

|||

Thank you for your kind answer~~~

No comments:

Post a Comment