Monday, March 12, 2012

Fastest way to determine if a query returns any rows

Hi,
I hope I don't embarres myself because of the simplicity of this questrion,
but what would be the fastest way to determine, if a query would return any
rows (without actually returning them, and I don't need to know how many
there are, either)?
Thanks,
KlausYou can use the EXISTS() clause like:
IF EXISTS( SELECT * FROM ... )
Anith|||Thanks!
"Anith Sen" <anith@.bizdatasolutions.com> schrieb im Newsbeitrag
news:OOgsG%23LMFHA.3296@.TK2MSFTNGP15.phx.gbl...
> You can use the EXISTS() clause like:
> IF EXISTS( SELECT * FROM ... )
> --
> Anith
>

No comments:

Post a Comment