Viewing 15 posts - 2,221 through 2,235 (of 10,143 total)
coolchaitu (8/21/2015)
Openquery can tune/improve performance but the architect told not to replace linked server with openquery. This is because we are migrating to cloud and architect said that...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
August 21, 2015 at 6:41 am
coolchaitu (8/21/2015)
There is a stored procedure. It uses linked server. As we will be migrating to amazon cloud, our architect instructed not to replace linked server with openquery. Please...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
August 21, 2015 at 5:44 am
squvi.87 (8/20/2015)
ChrisM@Work (8/20/2015)
squvi.87 (8/20/2015)
replaced with the new spliter but it tooks more timeDid you try the code I posted? Don't be shy about asking for explanations and further assistance.
Yes I...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
August 21, 2015 at 4:30 am
Good catch Scott. I'd write it like this which is more or less the same:
SELECT m.reportMonth,
m.reportYear,
ex.[service],
SUM(m.Vol) AS Vol,
SUM(m.Effort) AS effort
FROM (
SELECT reportMonth,
reportYear,
queueID,
SUM(volume) AS Vol,
SUM(cost) AS Effort
FROM [cts].[exception_Main] -- 14.5M rows...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
August 21, 2015 at 3:36 am
Sean Lange (8/20/2015)
Luis Cazares (8/20/2015)
Lynn Pettis (8/19/2015)
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
August 21, 2015 at 2:05 am
sgmunson (8/20/2015)
serviceaellis (8/20/2015)
thank you! This is closer than ever! It's producing the results in the detail format ...
Like J Livingston SQL came up with EXCEPT it was in a crosstab...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
August 21, 2015 at 1:59 am
mufadalhaiderster (8/20/2015)
I am still getting an error message on the FROM, outer apply clause(Incorrect syntax near the keyword from)
OUTER APPLY (
SELECT
COUNT(*) AS FundedLastYear,
COUNT(CASE WHEN a.DateDetailDisposed...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
August 20, 2015 at 9:43 am
-- create this index
CREATE INDEX ix_Helper ON [cts].[exception_Main]
(reportYear, reportMonth, exceptionDateTime, productArea)
INCLUDE (volume, cost, queueID, reportable)
-- run this query, capture the actual execution plan and post back
SELECT m.reportMonth
,m.reportYear
,ex.service
,sum(m.volume) AS...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
August 20, 2015 at 9:32 am
mufadalhaiderster (8/20/2015)
'DATEFROMPARTS' is not a recognized built-in function name'
any other techniques to...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
August 20, 2015 at 8:18 am
mufadalhaiderster (8/20/2015)
'DATEFROMPARTS' is not a recognized built-in function name'
any other techniques to...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
August 20, 2015 at 8:14 am
squvi.87 (8/20/2015)
replaced with the new spliter but it tooks more time
Did you try the code I posted? Don't be shy about asking for explanations and further assistance.
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
August 20, 2015 at 7:54 am
Dee Dee-422077 (8/20/2015)
Hi Jeff,Thanks for a quick reply.
The maximum price per itemid is 2.
Also the ItemID is dynamic
Thanks,
Dee
SELECT ItemID, ItemName,
Price1 = MIN(Price),
Price2 = MAX(Price)
FROM #TBL_SAMPLE_DATA
GROUP BY ItemID,...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
August 20, 2015 at 5:35 am
maxlezious (8/20/2015)
Really hope I become as good as you soon. Would you recommend me any t-sql books or just practicing on daily basis?
I'm planning on buying these at the weekend:
Grant...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
August 20, 2015 at 5:27 am
maxlezious (8/20/2015)
Absolute star, i am your fan now. Thank you again 🙂
Oh gosh :blush: I'm just a coder. You'll find this stuff as natural as counting on your fingers in...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
August 20, 2015 at 5:12 am
-- Sure, just remove ActType and Points from the GROUP BY...
SELECT
h.[hours],
Activities = COUNT(a.ActType),
Points = SUM(x.points)
FROM #tblActivities a
CROSS APPLY (
SELECT
[hours] = CASE
WHEN a.ActType = 'Motion' THEN DATEPART(HOUR,...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
August 20, 2015 at 4:47 am
Viewing 15 posts - 2,221 through 2,235 (of 10,143 total)