Returns the locking scheme of the specified object as a string.
lockscheme(object_name)
Or
lockscheme(object_id [, db_id])
is the name of the object whose locking scheme this function returns. object_name can also be a fully qualified name.
the ID of the database specified by object_id.
the ID of the object whose locking scheme this function returns.
Selects the locking scheme for the titles table in the current database:
select lockscheme("titles")
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)
Returns the locking scheme for the titles table (note that the object_name in this example is fully qualified):
select lockscheme(tempdb.ownerjoe.titles)
lockscheme returns varchar(11) and allows NULLs.
lockscheme defaults to the current database if:
You do not provide a fully-qualified object_name.
You do not provide a db_id
You provide a null for db_id.
If the specified object is not a table, lockscheme returns the string “not a table”.
SQL92 – Compliance level: Transact-SQL extension.
Any user can execute lockscheme.