Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to return an empty result
Message
From
15/07/2003 21:22:52
Rene Lovino
Bigfoot Global Solutions, Inc
Cebu, Philippines
 
 
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
00810496
Message ID:
00810505
Views:
13
Hi Roy,

Try "SELECT * FROM customer WHERE 1 = 2".
This will return the empty result set without checking the actuall content of the record since the expression is automatically evaluated to false.

Rene




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
Previous
Reply
Map
View

Click here to load this message in the networking platform