求sql server 存储过程返回空表的方法?
我在一个存储过程写了3个查询
select * from table1 where keyvalue = '1'
select * from table2 where keyvalue = '2'
select * from table3 where keyvalue = '3'
问题是这个存储过程返回的表的数量不确定,有时select * from table3 where keyvalue = '3'查询为空的话,就返回了前两个表;有时select * from table1 where keyvalue = '1'查询为空的话,就返回了后两个表。我想让这个存储过程一直返回的是3个表,如果其中某个查询为空的话返回的是空表,我该怎么做?谢谢!!!