You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Returns information about a page in a database. The function returns one row that contains the header information from the page, including the `object_id`, `index_id`, and `partition_id`. This function replaces the need to use `DBCC PAGE` in most cases.
Is the ID of the database. *DatabaseId* is **smallint**. Valid input is the ID number of a database. The default is NULL, however sending a NULL value for this parameter will result in an error.
35
+
*DatabaseId* | NULL | DEFAULT
36
+
Is the ID of the database. *DatabaseId* is **smallint**. Valid input is the ID number of a database. The default is NULL, however sending a NULL value for this parameter will result in an error.
39
37
40
-
*FileId* | NULL | DEFAULT
41
-
38
+
*FileId* | NULL | DEFAULT
42
39
Is the ID of the file. *FileId* is **int**. Valid input is the ID number of a file in the database specified by *DatabaseId*. The default is NULL, however sending a NULL value for this parameter will result in an error.
43
40
44
-
*PageId* | NULL | DEFAULT
45
-
41
+
*PageId* | NULL | DEFAULT
46
42
Is the ID of the page. *PageId* is **int**. Valid input is the ID number of a page in the file specified by *FileId*. The default is NULL, however sending a NULL value for this parameter will result in an error.
47
43
48
-
*Mode* | NULL | DEFAULT
49
-
44
+
*Mode* | NULL | DEFAULT
50
45
Determines the level of detail in the output of the function. 'LIMITED' will return NULL values for all description columns, 'DETAILED' will populate description columns. DEFAULT is 'LIMITED.'
Copy file name to clipboardExpand all lines: docs/relational-databases/system-functions/sys-fn-pagerescracker-transact-sql.md
+7-6Lines changed: 7 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,18 +31,16 @@ manager: "amitban"
31
31
32
32
Returns the `db_id`, `file_id`, and `page_id` for the given `page_resource` value.
33
33
34
-
35
34
[Transact-SQL Syntax Conventions](../../t-sql/language-elements/transact-sql-syntax-conventions-transact-sql.md)
36
35
37
36
## Syntax
38
-
39
37
```
40
38
sys.fn_PageResCracker ( page_resource )
41
39
```
42
40
43
41
## Arguments
44
-
*page_resource*
45
-
Is the 8-byte hexadecimal format of a database page resource.
42
+
*page_resource*
43
+
Is the 8-byte hexadecimal format of a database page resource.
`sys.fn_PageResCracker` is used to convert the 8-byte hexadecimal representation of a database page to a rowset that contains the database ID, file ID and page ID of the page. You can obtain a valid page resource from the `page_resource` column of the [sys.dm_exec_requests (Transact-SQL)](../../relational-databases/system-dynamic-management-views/sys-dm-exec-requests-transact-sql.md) dynamic management view or the [sys.sysprocesses (Transact-SQL)](../../relational-databases/system-compatibility-views/sys-sysprocesses-transact-sql.md) system view. The primary use of `sys.fn_PageResCracker` is to facilitate joins between these views and the [sys.dm_db_page_info (Transact-SQL)](../../relational-databases/system-dynamic-management-views/sys-dm-db-page-info-transact-sql.md) dynamic management function in order to obtain information about the page, such as the object to which it belongs.
54
+
`sys.fn_PageResCracker` is used to convert the 8-byte hexadecimal representation of a database page to a rowset that contains the database ID, file ID and page ID of the page.
55
+
56
+
You can obtain a valid page resource from the `page_resource` column of the [sys.dm_exec_requests (Transact-SQL)](../../relational-databases/system-dynamic-management-views/sys-dm-exec-requests-transact-sql.md) dynamic management view or the [sys.sysprocesses (Transact-SQL)](../../relational-databases/system-compatibility-views/sys-sysprocesses-transact-sql.md) system view. If an invalid page resource is used then the return is NULL.
57
+
The primary use of `sys.fn_PageResCracker` is to facilitate joins between these views and the [sys.dm_db_page_info (Transact-SQL)](../../relational-databases/system-dynamic-management-views/sys-dm-db-page-info-transact-sql.md) dynamic management function in order to obtain information about the page, such as the object to which it belongs.
57
58
58
59
## Permissions
59
-
The user needs VIEW SERVER STATE permission on the server.
60
+
The user needs `VIEW SERVER STATE` permission on the server.
60
61
61
62
## Examples
62
63
The `sys.fn_PageResCracker` function can be used in conjunction with [sys.dm_db_page_info (Transact-SQL)](../../relational-databases/system-dynamic-management-views/sys-dm-db-page-info-transact-sql.md) to troubleshoot page related waits and blocking in [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)]. The following script is an example of how you can use these functions to gather database page information for all active requests that are currently waiting on some type of page resource.
Copy file name to clipboardExpand all lines: docs/t-sql/functions/error-procedure-transact-sql.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,7 +43,7 @@ ERROR_PROCEDURE ( )
43
43
**nvarchar(128)**
44
44
45
45
## Return Value
46
-
When called within a CATCH block in a stored procedure or trigger, `ERROR_PROCEDURE` returns the name of the stored procedure or trigger in which the error originated.
46
+
When called in a CATCH block, `ERROR_PROCEDURE` returns the name of the stored procedure or trigger in which the error originated.
47
47
48
48
`ERROR_PROCEDURE` returns NULL if the error did not occur within a stored procedure or trigger.
0 commit comments