Viewing 15 posts - 151 through 165 (of 356 total)
Do you include weekends and national holidays in your calculation, or just working days?
April 15, 2009 at 4:34 am
Changing the != operator to > in the LEFT JOINs gives another 10-15% performance improvement.
CREATE TABLE #PR100 (Prime smallint primary key);
INSERT INTO #PR100
SELECT T.N
FROM Tally T
LEFT...
April 15, 2009 at 3:18 am
Barry,
Yep, your improved set-based query is 55% faster than my WHILE loop for primes < 10000 on my machine.
--Andrew
April 15, 2009 at 3:00 am
Sorry, I really should pay more attention.
This modification uses a correlated subquery to get the 2 latest rows for each MemberId.
It is untested so there could be more stupid mistakes.
SELECT...
April 14, 2009 at 5:09 pm
GSquared (4/14/2009)
set nocount on;
create table #Numbers (
Number smallint identity primary key);
go
insert...
April 14, 2009 at 4:26 pm
Instead of the ROW_NUMBER() function you can use the TOP 2 clause in a derived table to get the 2 most recent rows.
SELECT MemberId, AVG(LabValue)
FROM (
SELECT TOP...
April 14, 2009 at 3:59 pm
Will you have to do this query as part of your normal business processes or is it a one-off?
If the former, you could create a computed column in each of...
April 14, 2009 at 5:02 am
I don't understand why you are using the nvarchar data type when doing these datetime calculations. What's wrong with the datetime data type?
April 14, 2009 at 2:19 am
Florian Reischl (4/10/2009)
maxine (4/10/2009)
April 10, 2009 at 5:54 am
You could try this WHERE clause, but Adi's comment about potentially non-optimal query plans is stil relevant here, so you should test it for acceptable performance against a large data...
April 10, 2009 at 5:15 am
What do you want to do if more than one pair of date range parameters are not null?
@LoggedDateFrom NOT NULL
@LoggedDateTo NOT NULL
@PaidDateFrom NOT NULL
@PaidDateTo NOT NULL
@OutcomeDateFrom NULL
@OutcomeDateTo NULL
What do you...
April 10, 2009 at 3:34 am
I think this will work.
SELECT
c.value(N'ChargedUserID[1]', N'nvarchar(100)') AS ChargedUserID,
c.value(N'ChargedUserType[1]', N'nvarchar(100)') AS ChargedUserType,
c.value(N'SubscriberName[1]', N'nvarchar(100)') AS SubscriberName,
c.value(N'TrunkID[1]', N'int')...
April 10, 2009 at 2:53 am
Please give the structure of the table into which you wish to import this XML data, preferably in the form of a CREATE TABLE statement.
April 10, 2009 at 2:19 am
I did it semi-automatically using a regular expression based find-and-replace function in a text editior called TextPad.
There are TSQL scripts available that you can use to automatically generate insert statements...
April 9, 2009 at 9:23 am
I would make a couple of minor changes to Mark's query:
1) Use COUNT(a.fscore) rather than COUNT(*) when calculating cn in order to avoid counting rows with NULL fscore values.
...
April 9, 2009 at 6:08 am
Viewing 15 posts - 151 through 165 (of 356 total)