日期:2014-05-18  浏览次数:20379 次

SQL优化问题
请各位大虾帮忙看一下以下语句有没有地方需要优化的

create procedure p_jk
as
delete from zb.pos.dbo.jkcxtab
insert into zb.pos.dbo.jkcxtab select * from xmd.pos.dbo.jkcxtab where sn#=3
insert into zb.pos.dbo.jkcxtab select * from qmd.pos.dbo.jkcxtab where sn#=4
insert into zb.pos.dbo.jkcxtab select * from dhd.pos.dbo.jkcxtab where sn#=5
insert into zb.pos.dbo.jkcxtab select * from fzd.pos.dbo.jkcxtab where sn#=6
insert into zb.pos.dbo.jkcxtab select * from sdd.pos.dbo.jkcxtab where sn#=7
insert into zb.pos.dbo.jkcxtab select * from thc.pos.dbo.jkcxtab where sn#=8
insert into zb.pos.dbo.jkcxtab select * from jmwd.pos.dbo.jkcxtab where sn#=9
insert into zb.pos.dbo.jkcxtab select * from nhd.pos.dbo.jkcxtab where sn#=10
insert into zb.pos.dbo.jkcxtab select * from pszx.pos.dbo.jkcxtab where sn#=11
insert into zb.pos.dbo.jkcxtab select * from nad.pos.dbo.jkcxtab where sn#=12
insert into zb.pos.dbo.jkcxtab select * from sjd.pos.dbo.jkcxtab where sn#=13


------解决方案--------------------
都是不同的表,怎么优化????