大牛帮忙 100G数据库 执行效率有关问题 怎么弄成存储过程

大牛帮忙 100G数据库 执行效率问题 如何弄成存储过程
本帖最后由 uuwangorg 于 2013-04-13 14:08:30 编辑
select * from [QunInfo1].[dbo].[QunList1] where [QunInfo1].[dbo].[QunList1].[Class]='315' union all select * from [QunInfo1].[dbo].[QunList2] where [QunInfo1].[dbo].[QunList2].[Class]='315' union all select * from [QunInfo1].[dbo].[QunList3] where [QunInfo1].[dbo].[QunList3].[Class]='315' union all select * from [QunInfo1].[dbo].[QunList4] where [QunInfo1].[dbo].[QunList4].[Class]='315' union all select * from [QunInfo1].[dbo].[QunList5] where [QunInfo1].[dbo].[QunList5].[Class]='315' union all select * from [QunInfo1].[dbo].[QunList6] where [QunInfo1].[dbo].[QunList6].[Class]='315' union all select * from [QunInfo1].[dbo].[QunList7] where [QunInfo1].[dbo].[QunList7].[Class]='315' union all select * from [QunInfo1].[dbo].[QunList8] where [QunInfo1].[dbo].[QunList8].[Class]='315' union all select * from [QunInfo1].[dbo].[QunList9] where [QunInfo1].[dbo].[QunList9].[Class]='315' union all select * from [QunInfo1].[dbo].[QunList10] where [QunInfo1].[dbo].[QunList10].[Class]='315' union all select * from [QunInfo2].[dbo].[QunList11] where [QunInfo2].[dbo].[QunList11].[Class]='315' union all select * from [QunInfo2].[dbo].[QunList12] where [QunInfo2].[dbo].[QunList12].[Class]='315' union all select * from [QunInfo2].[dbo].[QunList13] where [QunInfo2].[dbo].[QunList13].[Class]='315' union all select * from [QunInfo2].[dbo].[QunList14] where [QunInfo2].[dbo].[QunList14].[Class]='315' union all select * from [QunInfo2].[dbo].[QunList15] where [QunInfo2].[dbo].[QunList15].[Class]='315' union all select * from [QunInfo2].[dbo].[QunList16] where [QunInfo2].[dbo].[QunList16].[Class]='315' union all select * from [QunInfo2].[dbo].[QunList17] where [QunInfo2].[dbo].[QunList17].[Class]='315' union all select * from [QunInfo2].[dbo].[QunList18] where [QunInfo2].[dbo].[QunList18].[Class]='315' union all select * from [QunInfo2].[dbo].[QunList19] where [QunInfo2].[dbo].[QunList19].[Class]='315' union all select * from [QunInfo2].[dbo].[QunList20] where [QunInfo2].[dbo].[QunList20].[Class]='315' union all select * from [QunInfo3].[dbo].[QunList21] where [QunInfo3].[dbo].[QunList21].[Class]='315' union all select * from [QunInfo3].[dbo].[QunList22] where [QunInfo3].[dbo].[QunList22].[Class]='315' union all select * from [QunInfo3].[dbo].[QunList23] where [QunInfo3].[dbo].[QunList23].[Class]='315' union all select * from [QunInfo3].[dbo].[QunList24] where [QunInfo3].[dbo].[QunList24].[Class]='315' union all select * from [QunInfo3].[dbo].[QunList25] where [QunInfo3].[dbo].[QunList25].[Class]='315' union all select * from [QunInfo3].[dbo].[QunList26] where [QunInfo3].[dbo].[QunList26].[Class]='315' union all select * from [QunInfo3].[dbo].[QunList27] where [QunInfo3].[dbo].[QunList27].[Class]='315' union all select * from [QunInfo3].[dbo].[QunList28] where [QunInfo3].[dbo].[QunList28].[Class]='315' union all select * from [QunInfo3].[dbo].[QunList29] where [QunInfo3].[dbo].[QunList29].[Class]='315' union all select * from [QunInfo3].[dbo].[QunList30] where [QunInfo3].[dbo].[QunList30].[Class]='315' union all select * from [QunInfo4].[dbo].[QunList31] where [QunInfo4].[dbo].[QunList31].[Class]='315' union all select * from [QunInfo4].[dbo].[QunList32] where [QunInfo4].[dbo].[QunList32].[Class]='315' union all select * from [QunInfo4].[dbo].[QunList33] where [QunInfo4].[dbo].[QunList33].[Class]='315' union all select * from [QunInfo4].[dbo].[QunList34] where [QunInfo4].[dbo].[QunList34].[Class]='315' union all select * from [QunInfo4].[dbo].[QunList35] where [QunInfo4].[dbo].[QunList35].[Class]='315' union all select * from [QunInfo4].[dbo].[QunList36] where [QunInfo4].[dbo].[QunList36].[Class]='315' union all select * from [QunInfo4].[dbo].[QunList37] where [QunInfo4].[dbo].[QunList37].[Class]='315' union all select * from [QunInfo4].[dbo].[QunList38] where [QunInfo4].[dbo].[QunList38].[Class]='315' union all select * from [QunInfo4].[dbo].[QunList39] where [QunInfo4].[dbo].[QunList39].[Class]='315' union all select * from [QunInfo4].[dbo].[QunList40] where [QunInfo4].[dbo].[QunList40].[Class]='315' union all select * from [QunInfo5].[dbo].[QunList41] where [QunInfo5].[dbo].[QunList41].[Class]='315' union all select * from [QunInfo5].[dbo].[QunList42] where [QunInfo5].[dbo].[QunList42].[Class]='315' union all select * from [QunInfo5].[dbo].[QunList43] where [QunInfo5].[dbo].[QunList43].[Class]='315' union all select * from [QunInfo5].[dbo].[QunList44] where [QunInfo5].[dbo].[QunList44].[Class]='315' union all select * from [QunInfo5].[dbo].[QunList45] where [QunInfo5].[dbo].[QunList45].[Class]='315' union all select * from [QunInfo5].[dbo].[QunList46] where [QunInfo5].[dbo].[QunList46].[Class]='315' union all select * from [QunInfo5].[dbo].[QunList47] where [QunInfo5].[dbo].[QunList47].[Class]='315' union all select * from [QunInfo5].[dbo].[QunList48] where [QunInfo5].[dbo].[QunList48].[Class]='315' union all select * from [QunInfo5].[dbo].[QunList49] where [QunInfo5].[dbo].[QunList49].[Class]='315' union all select * from [QunInfo5].[dbo].[QunList50] where [QunInfo5].[dbo].[QunList50].[Class]='315'...这里省略了 总共执行语句 有100多条 都是这个规律下来的