Viewing 15 posts - 2,626 through 2,640 (of 6,036 total)
GSquared (3/2/2009)
Well, if all the queries behave the same on all the indexes, then it doesn't really matter which one you use.
It does matter.
I did not see here tests for...
_____________
Code for TallyGenerator
March 2, 2009 at 2:11 pm
Unfortunately CEO's buy software after successful demos running out of empty databases populated with several dummy sample items.
Poor things, nobody told them they need to tests on a base of...
_____________
Code for TallyGenerator
February 28, 2009 at 3:16 pm
Senthil T (2/26/2009)
The above query does work like I wanted. It does not update the record 12345...
_____________
Code for TallyGenerator
February 27, 2009 at 1:08 am
CTE is just "C like" replacement for derived table.
UPDATE R
SET reportname = reportname + '-' + CAST(uniqueid AS VARCHAR(5))
FROM dbo.userreports R
INNER JOIN (SELECT userid, reportname
...
_____________
Code for TallyGenerator
February 26, 2009 at 6:32 pm
February 26, 2009 at 5:49 pm
Don't have time for article but I several times eliminated table/index scans by applying correct type to char constants.
To avoid even thinking about this problem I'm trying everywhere:
1) not to...
_____________
Code for TallyGenerator
February 24, 2009 at 4:38 pm
nathanb (2/19/2009)
_____________
Code for TallyGenerator
February 21, 2009 at 3:21 pm
Wow, what's happened to dir?
_____________
Code for TallyGenerator
February 20, 2009 at 2:22 pm
With 1.3 m records such query will return result right before Christmas. 🙂
You definitely need a separate column for precalculated results for historical records.
May be it's reasonable to populate it...
_____________
Code for TallyGenerator
February 20, 2009 at 5:33 am
Why would you need average for previous 12 months for EVERY RECORD AT ONCE?
Every time you probably need it only for one particular record.
And do you have proper index...
_____________
Code for TallyGenerator
February 20, 2009 at 3:50 am
Such correlated subquery on a decent amount of data is gonna kill even quite powerful server.
This should not be perfect but at least not so painful:
SELECT a.ItemNo, a.Date, AVG(b.Value) [12mAve]
FROM...
_____________
Code for TallyGenerator
February 19, 2009 at 7:54 pm
Only thing you need is to make sure your UDF returns sequence number in line with each value.
Then you're OK.
Otherwise you need to create another UDF which will return sequence...
_____________
Code for TallyGenerator
February 19, 2009 at 7:20 pm
There is a very strong reason for not allowing to pass tables to procedures as parameters.
Text, varchar(max) allow you to pass a variable up to 2GB in size.
To accept it...
_____________
Code for TallyGenerator
February 18, 2009 at 1:31 pm
BTW,
there is a good explanation why you need Calendar table in one of the recent posts here:
_____________
Code for TallyGenerator
February 17, 2009 at 10:02 pm
What about public holidays?
DECLARE @NextWorkingDay datetime
SELECT @NextWorkingDay = MIN(Date)
FROM dbo.Calendar
WHERE IsWorkingDay = 1 AND Date > GETDATE()
SELECT ...
FROM ...
EXPC_SHIP_DATE = @NextWorkingDay
_____________
Code for TallyGenerator
February 17, 2009 at 5:55 pm
Viewing 15 posts - 2,626 through 2,640 (of 6,036 total)