Checking on Cache Bindings

Use sp_helpcache to display the cache bindings for database objects, even if the cache bindings are invalid.

The following SQL statements reproduce cache binding commands from the information in a user database’s sysattributes table:
/* create a bindcache statement for tables */

select "sp_bindcache "+ char_value + ", " 
    + db_name() + ", " + object_name(object) 
from sysattributes 
where class = 3 
    and object_type = "T"
/* create a bindcache statement for indexes */

select "sp_bindcache "+ char_value + ", " 
    + db_name() + ", "   + i.name 
from sysattributes, sysindexes i
where class = 3 
    and object_type = "I" 
    and i.indid = convert(tinyint, object_info1) 
    and i.id = object