Skip to content

Latest commit

 

History

History
73 lines (53 loc) · 2.74 KB

File metadata and controls

73 lines (53 loc) · 2.74 KB
title SET RESULT_SET_CACHING (Transact-SQL)
description SET RESULT_SET_CACHING (Transact-SQL)
author mstehrani
ms.author emtehran
ms.reviewer wiassaf
ms.date 04/16/2020
ms.service sql
ms.subservice t-sql
ms.topic reference
dev_langs
TSQL
monikerRange =azure-sqldw-latest

SET RESULT SET CACHING (Transact-SQL)

[!INCLUDE asa]

Controls the result set caching behavior for the current client session.

Applies to [!INCLUDEssazuresynapse-md]

:::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: Transact-SQL syntax conventions

Syntax

SET RESULT_SET_CACHING { ON | OFF };

Remarks

Run this command when connected to the user database where you want to configure the result_set_caching setting for.

ON
Enables result set caching for the current client session. Result set caching cannot be turned ON for a session if it is turned OFF at the database level.

OFF
Disable result set caching for the current client session.

Note

Result set caching should not be used in conjunction with DECRYPTBYKEY. If this cryptographic function must be used, ensure you have result set caching disabled (either at session-level or database-level) at the time of execution.

Examples

Query the result_cache_hit column in sys.dm_pdw_exec_requests with a query's request_id to see if this query was executed with a result cache hit or miss.

SELECT result_cache_hit
FROM sys.dm_pdw_exec_requests
WHERE request_id = 'QID58286'

Permissions

Requires membership in the public role

SELECT result_cache_hit
FROM sys.dm_pdw_exec_requests
WHERE request_id = 'QID58286'

See also