--这样? create proc proc_name as select col from tb1 union all select col from tb2 union all ...
select * from table1 union all select * from table2 union all select * from table3 union all select * from table4 union all select * from table5 union all select * from table6
其实这样做没啥意义,直接在客户端写Select语句算了。
create proc proc_name as select * from tb1 select * from tb2 select * from tb3 select * from tb4 select * from tb5 select * from tb6 go在程序中可以用DataSet来接收存储过程产生的结果集,6个结果集会存放在6个DataTable中。
--这样?
create proc proc_name
as
select col from tb1 union all
select col from tb2 union all
...
union all
select * from table2
union all
select * from table3
union all
select * from table4
union all
select * from table5
union all
select * from table6
as
select * from tb1
select * from tb2
select * from tb3
select * from tb4
select * from tb5
select * from tb6
go在程序中可以用DataSet来接收存储过程产生的结果集,6个结果集会存放在6个DataTable中。