| title | Simulating an EXISTS Clause in a Natively Compiled Stored Procedure | Microsoft Docs |
|---|---|
| ms.custom | |
| ms.date | 06/13/2017 |
| ms.prod | sql-server-2014 |
| ms.reviewer | |
| ms.technology | in-memory-oltp |
| ms.topic | conceptual |
| ms.assetid | c0e187c1-cbd9-463c-b417-8a734574f102 |
| author | MightyPen |
| ms.author | genemi |
| manager | craigg |
Natively compiled stored procedures do not support the EXISTS clause, but there is a workaround:
DECLARE @exists BIT = 0
SELECT TOP 1 @exists = 1 FROM MyTable WHERE ...
IF @exists = 1 Migration Issues for Natively Compiled Stored Procedures
Transact-SQL Constructs Not Supported by In-Memory OLTP