Forum Moderators: open
SELECT *
FROM Foo
WHERE FooID IN ()
In MS SQL you get an error. (Just curious- do other DBs throw errors as well?)
But is it really an error? To me, if I pass in an empty list, then I would expect to get back no matching records, not an error message.
Yes, I can do (and often do) checking to see if the list is empty before passing it to the SQL statement. But it seems to me that it would be more efficient if SQL just returned 0 records instead of an error message.
Other people's thoughts/comments?