1.當資料來源透過cursor或程式邏輯產生的,最後資料放在table
variable,可以透過[執行SQL工作編輯器]把資料集取回
2.此結果集要指定給一個ssis變數,此變數型態為object
3.接著使用foreach將資料一筆一筆取出
4.指定foreach取出的資料,一個欄位要指定一個變數承接
5.這邊例子是透過這兩個變數組成insert語法
I had the same problem as the original poster but the
quoted answer did not solve the problem for me. The query still ran really
slow from a stored procedure. I found another answer here "Parameter Sniffing", Thanks Omnibuzz. Boils down to using "local Variables" in your stored procedure queries, but read the original for more understanding, it's a great write up. e.g. Slow way: CREATE PROCEDURE GetOrderForCustomers(@CustID varchar(20)) AS BEGIN SELECT * FROM orders WHERE customerid = @CustID END
Fast way:CREATE PROCEDURE GetOrderForCustomersWithoutPS(@CustID varchar(20)) AS BEGIN DECLARE @LocCustID varchar(20) SET @LocCustID = @CustID
SELECT * FROM orders WHERE customerid = @LocCustID END
Hope this helps somebody else, doing this reduced my
execution time from 5+ minutes to about 6-7 seconds. |
痛點 在現今服務至上環境下 , 即時回覆客戶問題以提升顧客滿意度儼然成為企業、服務業不可或缺的服務之一。但即時回覆問題所需付出成本內、外部分析如下, 如何解決此問題為本報告所要說明的部分。 Ø 因客服團隊人力需求較高且基本工資持續上升,人力資源成本持續上漲。 Ø 排程系統...