Hello All, A really cool feature of ASP.NET 2.0 in conjuction with a SQL 2005 database is the SqlDependency class to cache data (through SqlCacheDependency). It allows your web application to listen for notifications of changed data from the SQL 2005 server. Whereas with SQL 2000, your web application will have to poll the SQL server on a regular basis. Here's an example on how to set up a web application for SqlDependency. 1. Connect to your database with SQL Management Studio, and run this query to enable Service Broker for your database:
There are also rules for the SqlCommand you can run to qualify for query notifications. You must use a two-part name when referring to database objects. For example, 'FROM dbo.Table1' instead of just 'FROM Table1'. The valid queries are listed here, http://msdn2.microsoft.com/en-us/library/aewzkxxh(VS.80).aspx. DiscountASP.NET www.DiscountASP.NET
Do you support this for SQL Server 2000? I think you have to run something on the server to enable notifications. Swirl CoH/CoV: Online Badge Tracker http://www.cityinfoterminal.com
SQL 2000's Cache Dependency is sorta lame. The idea for SQLDependency is for the SQL server to notify the application when the data set changes. This is the way it works in SQL 2k5. With SQL 2k, this behavior is faked. The application will periodically poll a table in the database to see if the data changes. Anyway, the answer to your question is, yes, you can use SQL dependency with SQL 2k. However, you may not get the performance gain you expected unless you upgrade to SQL 2k5. Bruce DiscountASP.NET www.DiscountASP.NET
I have tried running the ALTER DATABASE statement on my database but it just hangs, saying "Executing query". I waited for over 12 minutes before stopping the query. Any ideas?
Please send a support ticket. System administrators will have to check your SQL 2005 database. Aristotle DiscountASP.NET www.DiscountASP.NET