Categories:
.NET (961)
C (387)
C++ (185)
CSS (84)
DBA (8)
General (31)
HTML (48)
Java (641)
JavaScript (220)
JSP (109)
JUnit (31)
MySQL (297)
Networking (10)
Oracle (562)
Perl (48)
Perl (9)
PHP (259)
PL/SQL (140)
RSS (51)
Software QA (28)
SQL Server (5)
Struts (20)
Unix (2)
Windows (3)
XHTML (199)
XML (59)
Other Resources:
How do we enable SQL Cache Dependency in ASP.NET 2.0
How do we enable SQL Cache Dependency in ASP.NET 2.0?
✍: Guest
Below are the broader steps to enable a SQL Cache Dependency:-
Enable notifications for the database.
Enable notifications for individual tables.
Enable ASP.NET polling using web.config file
Finally use the Cache dependency object in your ASP.NET code
Enable notifications for the database.
Before you can use SQL Server cache invalidation, you need to enable notifications for
the database. This task is performed with the aspnet_regsql.exe command-line utility,
which is located in the c:\[WinDir]\Microsoft.NET\Framework\[Version] directory.
aspnet_regsql -ed -E -d Northwind
-ed :- command-line switch
-E: - Use trusted connection
-S: - Specify server name it other than the current computer you are working on
-d: - Database Name
So now lets try to understand what happens in the database because of
aspnet_regsql.exe. After we execute the aspnet_regsql -ed -E -d Northwind command
you will see one new table and four new stored procedures created.
Essentially, when a change takes place, a record is written in this table. The SQL Server
polling queries this table for changes.
Just to make brief run of what the stored procedures do.
AspNet_SqlCacheRegisterTableStoredProcedure :- This stored procedure sets a table
to support notifications. This process works by adding a notification trigger to the table,
which will fire when any row is inserted, deleted, or updated.
AspNet_SqlCacheUnRegisterTableStoredProcedure:- This stored procedure takes a
registered table and removes the notification trigger so that notifications won't be generated.
AspNet_SqlCacheUpdateChangeIdStoredProcedure:- The notification trigger calls this
stored procedure to update the AspNet_SqlCacheTablesForChangeNotification table,
thereby indicating that the table has changed.
AspNet_SqlCacheQueryRegisteredTablesStoredProcedure :- This extracts just the table
names from the AspNet_SqlCacheTablesForChangeNotification table. Its used to get a
quick look at all the registered tables.
AspNet_SqlCachePollingStoredProcedure :- This will get the list of changes from the
AspNet_SqlCacheTablesForChangeNotification table. It is used to perform polling.
2007-10-23, 5877👍, 0💬
Popular Posts:
Can you explain in brief how can we implement threading ? Private Sub Form1_Load(ByVal sender As Sys...
How To Use SELECT Statement to Count the Number of Rows? - Oracle DBA FAQ - Understanding SQL SELECT...
How can I show HTML examples without them being interpreted as part of my document? Within the HTML ...
How To Get the Uploaded File Information in the Receiving PHP Script? Once the Web server received t...
If we have two version of same assembly in GAC how do we make a choice ? OK first lets try to under...