Forum Replies Created

Viewing 15 posts - 1,201 through 1,215 (of 5,590 total)

  • RE: Are the posted questions getting worse?

    SQLRNNR (6/6/2011)


    Lynn Pettis (6/5/2011)


    Jeff Moden (6/5/2011)


    Lynn Pettis (6/4/2011)


    Okay denizens of The Thread, I got a call yesterday evening from my oldest daughter that actually left me speechless.

    I am going to...

  • RE: Can this be converted to a set based query?

    tfeuz (6/6/2011)


    Wayne...

    Here is index #1

    USE [TBR3]

    GO

    /****** Object: Index [_dta_index_InvoiceLineItem_43_800057936__K2_K28_K17_K21_K1_10] Script Date: 06/06/2011 11:24:37 ******/

    CREATE NONCLUSTERED INDEX [_dta_index_InvoiceLineItem_43_800057936__K2_K28_K17_K21_K1_10] ON [dbo].[InvoiceLineItem]

    (

    [InvoiceKey] ASC,

    [ProductRebateCategory] ASC,

    [GrossAmount] ASC,

    [NetAmount] ASC,

    [InvoiceLineKey] ASC

    )

    INCLUDE...

  • RE: Can this be converted to a set based query?

    tfeuz (6/6/2011)


    Wayne,

    So I have done some more testing and this is what I found....

    The more recent versions of the stored procedures seem to run in the 30-45 second range for...

  • RE: Can this be converted to a set based query?

    If you add a ColToUse column to the RB_Rule table, you can change this:

    SELECT @Col2Use = CASE (CalcDateType)

    ...

  • RE: Can this be converted to a set based query?

    tfeuz (6/6/2011)


    Found it ---

    We need to do string manipulation to build the SQL....

    Good. As soon as I saw the error message, I started doing the head-slap thing.

    For query plan re-use,...

  • RE: Why do we use # for temp tables name?

    Just be careful with global temp tables: as soon as the connection that created it goes away, the global temp table will go away also (as soon as all other...

  • RE: Can this be converted to a set based query?

    WayneS (6/5/2011)


    First, create 5 indexes on the Invoice table:

    1. ShipToDiscountDueDate , InvoiceKey INCLUDE ShipToKey

    2. ShipToNetDueDate, InvoiceKey INCLUDE ShipToKey

    3. TermsDiscountDueDate, InvoiceKey INCLUDE ShipToKey

    4. TermsNetDueDate, InvoiceKey INCLUDE ShipToKey

    5. InvoiceDate, InvoiceKey INCLUDE ShipToKey

    I...

  • RE: Can this be converted to a set based query?

    Alternatively, you could still do that all in one proc, but it would use dynamic sql to build a string with the proper column, then execute that string. This way,...

  • RE: Can this be converted to a set based query?

    tfeuz (6/5/2011)


    Wayne,

    I think I am missing something -- the invoicekey is the PK and it is clustered:

    It's not you missing it, it was me. I didn't scroll down far enough...

  • RE: Increment a date T-SQL Statement

    Craig Farrell (6/4/2011)


    If Jeff is willing to put his name on the line, something he considers quite valuable, to prove a point with numbers... it's worth listening to.

    +1000.

    + more...

  • RE: Can this be converted to a set based query?

    This isn't a clustered index, and there is a clustered index on that table.

    Isn't the Primary Key on this table the InvoiceKey column? (which means that it has an...

  • RE: Are the posted questions getting worse?

    Lynn Pettis (6/4/2011)


    Okay denizens of The Thread, I got a call yesterday evening from my oldest daughter that actually left me speechless.

    I am going to be grandfather![/i]

    Looks like I'll need...

  • RE: Can this be converted to a set based query?

    tfeuz (6/3/2011)


    All;

    I did the requested cumulative changes and it actually got worse -- it is now at 25 seconds instead of 18....

    Execution plan attached

    TF

    Even though time is probably the easiest...

  • RE: Save ALL plans in 1 operation

    Ninja's_RGR'us (6/3/2011)


    WayneS (6/3/2011)


    Does this work?

    Bingo!

    Thanks a mil.

    NP.

  • RE: Are the posted questions getting worse?

    Just received a wonderful PM... someone thanking me for the help I'm doing... for someone else!

Viewing 15 posts - 1,201 through 1,215 (of 5,590 total)