在sql server中有没有办法并行插入Temp表

编程入门 行业动态 更新时间:2024-10-25 08:18:59
本文介绍了在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表

本文发布于:2023-10-28 13:36:06,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1536784.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:中有   没有办法   sql   server   Temp

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!