Viewing 15 posts - 1,726 through 1,740 (of 4,080 total)
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
March 25, 2010 at 7:48 am
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
March 25, 2010 at 7:21 am
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
March 25, 2010 at 7:19 am
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
March 25, 2010 at 7:07 am
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
March 25, 2010 at 6:59 am
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
March 25, 2010 at 6:41 am
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
March 25, 2010 at 6:38 am
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
March 25, 2010 at 6:25 am
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
March 24, 2010 at 9:29 pm
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
March 24, 2010 at 9:12 pm
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
March 24, 2010 at 9:00 pm
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
March 24, 2010 at 8:53 pm
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
March 24, 2010 at 8:33 pm
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
March 24, 2010 at 8:07 pm
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
March 24, 2010 at 7:27 pm
Viewing 15 posts - 1,726 through 1,740 (of 4,080 total)