CXPACKET wait types...

  • Another thing which we can try here is

    ----instead of

    WHERE StatementID IN (SELECT StatementID FROM MyDB_ARCHIVE.dbo.StatementHeader)

    -----test it

    WHERE exists (SELECT 1 FROM MyDB_ARCHIVE.dbo.StatementHeader A where A.StatementID = d.StatementID )/code]

    AND

    -----create a temp table with suitable clus index

    INSERT INTO #tmp

    SELECT *, GETDATE() FROM MyDB.dbo.DoDetailTxns

    WHERE StatementID IN (SELECT StatementID FROM MyDB_ARCHIVE.dbo.StatementHeader)

    INSERT INTO MyDB_ARCHIVE.dbo.DoDetailTxns

    select * from #tmp

    -----then perfom delete in loop

    WHILE @BatchSize <> 0

    BEGIN

    /* Delete the data */

    DELETE TOP (@BatchSize) FROM MyDB.dbo.DoDetailTxns

    WHERE exists (SELECT 1 FROM #tmp A where A.StatementID = d.StatementID

    ---other code

    END

    -------Bhuvnesh----------
    I work only to learn Sql Server...though my company pays me for getting their stuff done;-)

  • Please note: year old thread.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • GilaMonster (1/11/2013)


    Please note: year old thread.

    How awesome would it be for this site to have an option to "close" or "resolve" button for threads???

    🙂

    ______________________________________________________________________________Never argue with an idiot; Theyll drag you down to their level and beat you with experience

  • MyDoggieJessie (1/11/2013)


    GilaMonster (1/11/2013)


    Please note: year old thread.

    How awesome would it be for this site to have an option to "close" or "resolve" button for threads???

    🙂

    Wouldn't ever be a good idea. Things change too fast, so does the community's collective knowledge.

    Also google doesn't really care wether it's 5 seconds, 5 months or 5 years old.

    Neither do I for that matter.

  • Agreed. But wouldn't you agree that it would be more helpful (especially since Google is one of the best resources for finding solutions) that if you knew upfront that the thread you were reading was "solved" you could more easily bypass the unsolved threads, and skip to the ones that you knew had be successfully answered?

    ______________________________________________________________________________Never argue with an idiot; Theyll drag you down to their level and beat you with experience

  • MyDoggieJessie (1/11/2013)


    Agreed. But wouldn't you agree that it would be more helpful (especially since Google is one of the best resources for finding solutions) that if you knew upfront that the thread you were reading was "solved" you could more easily bypass the unsolved threads, and skip to the ones that you knew had be successfully answered?

    Yes, but how many guys do you need to hire to validate that information? Who do you hire?

    A little warning in the post option would be nice... this thread has been inactive for x months, are you sure you don't want to start a new thread? Then if they ignore there's not much more to do or say about that.

Viewing 6 posts - 16 through 20 (of 20 total)

You must be logged in to reply to this topic. Login to reply