Forum Replies Created

Viewing 15 posts - 1,726 through 1,740 (of 4,080 total)

  • RE: Get minimum data without using MIN() function

    With a proper index in place, a TOP(1) subquery can beat the performance of a min(), because the query plan only has to do a one-row seek. I...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Assign value to another fieldname using CASE statement

    Looking at the number of posts you've been involved in lately, and extrapolating from that a certain percentage of BOL lookups, factor in typing time.....

    Tell me you have a life...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Get minimum data without using MIN() function

    I still don't understand why the obvious query is unacceptable.

    select assetID, min([date])

    from t1

    where [date] < inceptionDate

    group by assetID

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Stopping Duplicates with INSTEAD OF INSERT Problem

    Understood and agreed. I'm just glad that we're on the same team.

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Passing a table variable to a procedure

    When all code is posted, and posted correctly, we have a far better chance of getting the answer right on the first try. Please repost everything.

    /* Create a...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Assign value to another fieldname using CASE statement

    Paul, please tell me you don't have all that committed to memory. 😉

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Stopping Duplicates with INSTEAD OF INSERT Problem

    Paul, thanks for the save. I wasn't even close to thinking about isolation levels last night.

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Get minimum data without using MIN() function

    1. Why do you want to avoid the min() function? That's like saying "I want to saw a board in half, but I don't...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Creating Indices on Temp Tables from Stored Procedures

    Rather than creating an index on the actual table, I instead use an existing index to filter down the records as much as possible, and store the results into a...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Stopping Duplicates with INSTEAD OF INSERT Problem

    Next question: If the objective is to prevent two rows from having the same TableID, why isn't the primary key on [TableID] only? That would put...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Stopping Duplicates with INSTEAD OF INSERT Problem

    The duplicates you mention: Are they simply duplicates of the [TableID], or is the [createdTime] also identical. Since it's a datetime field it would have...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Creating Indices on Temp Tables from Stored Procedures

    I don't understand what a temporary table would do that a covering index wouldn't do.

    If your data isn't read-only and non-volatile, maintaining a set of temporary tables...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Stopping Duplicates with INSTEAD OF INSERT Problem

    I just used your procedure's BEGIN/INSERT/VALUES/COMMIT logic to insert multiple rows with the same GUID.

    The trigger worked just as you intended it should.

    We are...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Stopping Duplicates with INSTEAD OF INSERT Problem

    Okay... I obviously misunderstood your issue. I agree that a single insert with a VALUES clause like that shouldn't create two rows. (This is where seeing source...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Passing a table variable to a procedure

    CREATE PROCEDURE dbo.usp_sc_customer_tx

    @I InsertIDs READONLY,

    @C ClearIDs READONLY, ...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

Viewing 15 posts - 1,726 through 1,740 (of 4,080 total)