lockscheme

Description

Returns the locking scheme of the specified object as a string.

Syntax

lockscheme(object_name)

Or

lockscheme(object_id [, db_id])

Parameters

object_name

is the name of the object whose locking scheme this function returns. object_name can also be a fully qualified name.

db_id

the ID of the database specified by object_id.

object_id

the ID of the object whose locking scheme this function returns.

Examples

Example 1

Selects the locking scheme for the titles table in the current database:

select lockscheme("titles")

Example 2

Selects the locking scheme for object_id 224000798 (in this case, the titles table) from database ID 4 (the pubs2 database):

select lockscheme(224000798, 4)

Example 3

Returns the locking scheme for the titles table (note that the object_name in this example is fully qualified):

select lockscheme(tempdb.ownerjoe.titles)

Usage

Standards

SQL92 – Compliance level: Transact-SQL extension.

Permissions

Any user can execute lockscheme.