none
關於 Replication 產生該處理無法大量複製 問題請教 RRS feed

  • 一般討論

  • 資料同步 (REPLICATION)快照式發行

    來源Tongue TiedQL SERVER 2000

    目地Tongue TiedQL SERVER 2005

    錯誤: 該處理無法大量複製(BULK COPY)到資料表 (只有部份TABLE會有此ERROR)

    另改採使用DTS試,傳回下列

    錯誤: 失敗資料列的數目超過指定的最大值 (只有部份TABLE會有此ERROR)

     

    想請教,以上問題 該如何做調整??

    2006年12月28日 上午 02:02

所有回覆

  • 來源 : SQL SERVER 2000 已更新sp4

    但查到下列hotfix 文章

    http://support.microsoft.com/kb/885460

    不知在sp4中是否有包含此fix呢 ? 或是否有相關? 看其它網站的討論區

    也有與我碰到相同問題的人, 麻煩各位先進可以提供一下你們的經驗~

     

    感謝~~

     

     

    2006年12月28日 上午 07:25
  • 問題已解決了. Thanks~
    2006年12月28日 上午 09:28
  • like this;
    CREATE PROC procGetProductStats2 AS
    DECLARE @OrderCounts TABLE(ProductID int, OrderCount int)
    INSERT INTO @OrderCounts
    SELECT ProductID, COUNT(DISTINCT OrderID)
    FROM [Order Details]
    GROUP BY ProductID
    ORDER BY COUNT(DISTINCT OrderID) DESC

    SELECT COUNT(ProductID), OrderCount
    FROM @OrderCounts
    GROUP BY OrderCount
    ORDER BY OrderCount DESC

    2008年7月31日 下午 01:01
  • Java:

     

    Is this code in connection to your post earlier this morning?

     

    EDIT:

     

    This looks like it is connected to an earlier post.  I will merge the posts in a few minutes.

    2008年7月31日 下午 01:04
  • Java:

     

    In response to your earlier question, this is not a good example of when to use a temporary table.  In this case the temporary table will slow down the process.  Your procedure would be better just directly selecting the data out with something like:


    Code Snippet

    CREATE PROC procGetProductStats2 AS

    SELECT ProductID, COUNT(DISTINCT OrderID)
    FROM [Order Details]
    GROUP BY ProductID
    ORDER BY COUNT(DISTINCT OrderID) DESC

     

     

    This version of the procedure might execute faster because it is a 1-step process rather than a 2-step process.

    2008年7月31日 下午 01:09
  • thanks .
    icant delete this topic.
    sorry for it.
    2008年7月31日 下午 01:12
  • An additional thought to your example has to do with the usage of your procedure.  Another line of thought might be to use an inline table valued function rather than a procedure for example a function such as:

     

    Code Snippet

    create function dbo.procGetProductStats2
    returns table
    return
    ( SELECT ProductID, COUNT(DISTINCT OrderID)
      FROM [Order Details]
      GROUP BY ProductID
      ORDER BY COUNT(DISTINCT OrderID) DESC
    )

     

     

    The advantage of this function is that it will optimize well and if you ever want to combine the result set with other tables it will be much easier if the result set comes from a function rather than a procedure.
    2008年7月31日 下午 01:12