DBCC UNPINTABLE in Microsoft SQL Server


Marks a table as unpinned. After a table is marked as unpinned, the table pages in the buffer cache can be flushed.


DBCC UNPINTABLE ( database_id , table_id )

Is the database identification (ID) number of the database containing the table to be pinned. To obtain the database ID, use DB_ID.
Is the object ID of the table to be pinned. To determine the object ID, use OBJECT_ID.

DBCC UNPINTABLE does not cause the table to be immediately flushed from the data cache. It specifies that all of the pages for the table in the buffer cache can be flushed if space is needed to read in a new page from disk.

Result Sets
DBCC UNPINTABLE returns this result set (message):
DBCC execution completed. If DBCC printed error messages, contact your system administrator.

DBCC UNPINTABLE permissions default to members of the sysadmin fixed server role and are not transferable.

This example unpins the authors table in the pubs database.

DECLARE @db_id int, @tbl_id int
USE pubs
SET @db_id = DB_ID('pubs')
SET @tbl_id = OBJECT_ID('pubs..authors')
DBCC UNPINTABLE (@db_id, @tbl_id)


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.