Export (0) Print
Expand All

Simulating an EXISTS Clause in a Natively Compiled Stored Procedure

SQL Server 2014

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
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft