SQL Server high-speed cache dependency analysis

Source: Internet
Author: User
Steps for using SQLServer high-speed cache dependency.

Steps for using SQL Server high-speed cache dependency.

1. Enable the database to support SQL high-speed cache dependencies.
2. Enable the table to support SQL high-speed cache dependencies.
3. The web. config file of the ASP. NET application contains the SQL connection string.
4. Use SQL high-speed cache dependency as follows:
1) create a SqlCacheDependency object by programming in the code.
2) Add the SqlCacheDependency attribute to the OutputCache command.
3) Use Response. AddCacheDependency to add a SqlCacheDependency instance to the Response object.


Allows the database to enable SQL high-speed cache dependency.
Disable the database from enabling SQL high-speed cache dependencies.
Allows the table to enable SQL high-speed cache dependency. The-t option is required.
Disable the SQL high-speed cache dependency on tables. The-t option is required.
Supports or disables SQL high-speed cache-dependent table names. -Et or-dt is required.
Lists All Tables with SQL high-speed cache dependency enabled.Use the high-speed cache disabling function (the following settings can also be performed in 2005)

Enable high-speed cache dependency for tables.
Example:

Note:

Note:



ConnectionString = "Data Source =.; Initial Catalog = Northwind; User ID = sa; Password = sa"
ProviderName = "System. Data. SqlClient"/>


: Provides an identifier for the SQL Server database.
: Specifies the connection name.
: Specifies the time interval for SQL Server to take turns detection. The default value is 5 seconds or 500 milliseconds. This attribute is not required for the SQL 2005 notification function.
After the web. config file is correctly configured, you can disable the SQL Server cache function on the page. ASP. NET will put the SQL Server request on a completely different thread in the AspNet_SqlCacheTablesForChangeNotification table to see if the changeId number is increasing. If the number changes, ASP. NET will know that the underlying SQL Server table has been modified, and a new result set should be retrieved. It determines whether an SQL Server call should be performed. The request to the AspNet_SqlCacheTablesForChangeNotification table will get a result. After the SQL Server high-speed cache disabling function is enabled, the execution will be very fast.
%>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.