Sets option values for user-defined tables.
sp_tableoption [@TableNamePattern =] 'table'
[,[@OptionName =] 'option_name']
[,[@OptionValue =] 'value']
Value | Description |
---|---|
pintable | When disabled (the default), it marks the table as no longer RAM-resident. When enabled, marks the table as RAM-resident. |
table lock on bulk load | When disabled (the default), it causes the bulk load process on user-defined tables to obtain row locks. When enabled, it causes the bulk load processes on user-defined tables to obtain a bulk update lock. |
insert row lock | For Microsoft® SQL Server™ version 6.5, enabled or disabled Insert Row Locking (IRL) operations on the specified table. Row-level locking is enabled by default in SQL Server version 7.0. The locking strategy of SQL Server is row locking with possible promotion to page or table locking. This option does not alter the locking behavior of SQL Server (it has no effect) and is included only for compatibility of existing scripts and procedures. In a future version of SQL Server, this option may not be supported. |
0 (success) or error number (failure)
Column name | Data type | Description |
---|---|---|
Available Table Options | nvarchar(35) | List of available table options |
Default Value | int | Default values of the associated with the table option |
Only members of the sysadmin fixed server role can modify the pintable table option.
Members of the sysadmin fixed server role or the db_owner fixed database role can modify the insert row lock option for any user-defined table. Other users can modify options only for tables they own.
Any user can run sp_tableoption to generate a report listing table option values for all user-defined tables.
USE pubs
EXEC sp_tableoption 'sales'
USE pubs
EXEC sp_tableoption 'sales', 'pintable'
USE pubs
EXEC sp_tableoption 'sales', 'pintable', 'false'
DBCC PINTABLE | System Stored Procedures |
DBCC UNPINTABLE |