Wednesday, March 7, 2012

Fasted way to check if a recordset is empty using SQL

Hi Anders,
i would use
select count(PKField) from ViewName
perhaps the using of the top attribute was quicker
like this (untested)
select top 1 pkField from ViewName
Good luck.
Niels

>--Original Message--
>Hello!
>I need to check if a View is empty or not. Which is the
fasted way of doing
>this using a SQL statement?
>// Anders
>.
>
Hello Niels!
On Tue, 2 Nov 2004 01:13:33 -0800, nieurig wrote:

> select count(PKField) from ViewName
>
This works fine!
Thank you!
// Anders

No comments:

Post a Comment