Friday, February 24, 2012

Enable table dependency in AdventureWorks db?

I have been having trouble with enabling table dependencies using the aspnet_regsql utility on the Product table in the AdventureWorks database. It is in the Production in the normal dbo schema. When I run the utility to enable the table dependency for SQL cache notifications it fails because it tries to prefix the reference to the table with dbo.

Now I know it just adds a trigger for INSERT, UPDATE and DELETE where it runs a stored procedure to update the main table dependency table, but if I do that manually it requires that the trigger also run in the Production schema. I am not sure if this will still work with SQL query notifications.

http://msdn2.microsoft.com/en-us/library/ms124719.aspx

Please reply if you can help.

Hi Offwhite,

Based on your description, I understand that you need to register the

Production.Product table for Sql Cache Dependency. However, because of the

schema name is not dbo, the registration failed.

Based on my research, this is by design in aspnet_regsql.exe tool. The stored

procedure generated for AspNet_SqlCacheRegisterTableStoredProcedure, has

hardcoded dbo as the schema name in it.

To change this behavior, we have to manually modify the stored procedure, by

changing the full name of the trigger it is creating. Here is an article

about how to do this.

http://www.feedshow.com/show_items-feed=0461b14d31d1ce82afaef7eac4e0ed1a

HTH. If this does not answer you question, please feel free to mark it as Not Answered and post your reply. Thanks!

|||

Thanks! That is gotten me a little farther but I am now having some more issues. I would appreciate some help. I have posted my question and progress here...

http://forums.asp.net/thread/1594211.aspx

No comments:

Post a Comment