Hi Roy,
You can do it in one of two ways. You can use SQL Server specific command SET FMTONLY or WHERE condition 1=2. Neither would consume much of resources regardless of # of records in a table.
lcSql = "SET FMTONLY ON SELECT * FROM customer SET FMTONLY OFF"
lnResult = SqlExec(lnConn, lcSql)
SELECT * FROM customer WHERE 1=2
lnResult = SqlExec(lnConn, lcSql)
The second one should work for any backend but may not be as efficient as on SQL Server.
>Hi,
>
>I want to do a select statement to return an empty result without consuming resources.
>
>Let's say I just want to bring an empty result from the customers table, I could do "SELECT * FROM customer WHERE customer_id = -8994849" something like this but if the table is huge I imagine it will consume resources.
>
>Any way just to bring an empty result set without consuming resources?
>
>Thanks
--sb--