本文介绍了在sql server中有没有办法并行插入Temp表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
I have a Dynamic SQl Query as below Create #TempTable(ColumnA int, ColumnB int, ColumnC Int) Insert into #TempTable(select A,B,C from Table1 where some condition formed dynamically) Insert into #TempTable(select A,B,C from Table1 where some condition formed dynamically) Insert into #TempTable(select A,B,C from Table1 where some condition formed dynamically) Insert into #TempTable(select A,B,C from Table1 where some condition formed dynamically) Insert into #TempTable(select A,B,C from Table1 where some condition formed dynamically) select * from #TempTable drop table #TempTable
注意:#TempTablecan中的插入语句数量从10到100不等因此需要大量的时间执行 我想知道的是,在SQL Server 2008 R2中是否有一种方法可以使用它来并行执行Insert语句并缩短执行时间? ?
Note : The Number of insert statements into the #TempTablecan vary from 10 to 100 hence it takes a lot of time to execute What i wanted to know is , Is There a way in SQL server 2008 R2 using which i can execute the Insert statements parallely and Reduce the Execution Time??
推荐答案如果你的条件在每一行都没有变化那么试试.. :) if your condition is not varying at every row then try that.. :) SELECT * INTO #TempTable FROM SourceTable WHERE.....--condition
更多推荐
在sql server中有没有办法并行插入Temp表
发布评论