sql server 2008 - What is an efficient way to exclude all results from a sql query? -


surprised haven't seen before, googling doesn't yield insight.

i'm working framework going generate sql query, or not. have ability add filtering on query, , case has arisen wish exclude possible results.

my initial thought add where 1 = 0 clause of query.

is there more optimized or efficient way this?

since answer vary between platforms, run on sql server 2008

you correct, best , used way exclude results query:

where 1=0 

Comments

Popular posts from this blog

javascript - ScrollTo Effect (href to div) -

javascript - ng-class not responding to change in model in Angular? -

javascript - document.registerElement extending HTMLInputElement prototype while using custom tag name to avoid implicit browser style -