January 31, 2011 at 11:26 pm
if exists(select * from t1 or select * from t2)
begin
select 'xxx'
end
not running. suggestion ?
January 31, 2011 at 11:33 pm
the error you getting after running the query, clearify the reason itself.
See the error in your query result window.
----------
Ashish
February 1, 2011 at 2:35 am
Isn't it possible to use more than one condition inside if exists() ?
February 1, 2011 at 2:43 am
Isn't it possible to use more than one condition inside if exists() ?
There are not two condition, there are totally 2 different select statement which are no where related to each other to be compared by OR operator
if exists(select * from t1 or select * from t2)
----------
Ashish
February 1, 2011 at 3:29 am
EXISTS operator only works with single SELECT statement. In your case it will work as mentioned below..
if exists(select * from t1) or exists(select * from t2)
begin
select 'xxx'
end
Abhijit - http://abhijitmore.wordpress.com
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply