SQL Server automatically loads the data it needs to work with into its cache. This is called pages. These data pages stay in SQL Server’s cache until there is no room for them and it gets flushed out of the data cache onto disk.
Whenever SQL Server needs these data pages again, it must to go to disk and read them into the cache again. To ensure a table always stays available in SQL Server’s cache you could Pin the table and Unpin it when it is not needed anymore. For this you make use of the DBCC PINTABLE and DBCC UNPINTABLE Functions. Here is a very small example:
Pinning
DECLARE @DatabaseID INT, @TableID INTUSE DatabaseName SET @DatabaseID = DB_ID('DatabaseName') SET @TableID = OBJECT_ID('TableName') DBCC PINTABLE (@DatabaseID, @TableID)
Unpinning
DECLARE @DatabaseID INT, @TableID INT USE DatabaseName SET @DatabaseID = DB_ID('DatabaseName') SET @TableID = OBJECT_ID('TableName') DBCC UNPINTABLE (@DatabaseID, @TableID)
Charlie has over a decade of experience in website administration and technology management. As the site admin, he oversees all technical aspects of running a high-traffic online platform, ensuring optimal performance, security, and user experience.
Related Posts
- New Flexera Software App Portal Release Adds Support for Cloud & Apple?? Mac Apps, and ROI Dashboard – Extending Enterprise App Store Leadership
- How To Install APK On Android
- Report: Docker Raises $1 Billion in Funding
- Gartner Predicts 16.5% Growth in Public Cloud Computing
- Windows Store for Business Now Offering Paid Apps




















