Dropping cache bindings

Two commands drop cache bindings:

The syntax for sp_unbindcache is:

sp_unbindcache dbname [,[owner.]tablename 
[, indexname | "text only"] ]

This commands unbinds the titleidind index on the titles table in the pubs2 database:

sp_unbindcache pubs2, titles, titleidind

To unbind all the objects bound to a cache, use sp_unbindcache_all, giving the cache’s name:

sp_unbindcache_all pubs_cache

NoteYou cannot use sp_unbindcache_all if more than eight databases objects in eight databases are bound to the cache. You must use sp_unbindcache on individual databases or objects to reduce the number of databases involved to eight or less.

When you drop a cache binding for an object, all the pages currently in memory are cleared from the cache.