Viewing 15 posts - 4,471 through 4,485 (of 10,143 total)
While you're investigating JLS' questions, this is worth playing with:
SELECT
[DTstart date],
[DTend date],
SecondsDifference = DATEDIFF(second,[DTend date],[DTstart date]),
SecondsDifference = ABS(DATEDIFF(second,[DTstart date],[DTend date]))
FROM (
SELECT
[DTstart date] = CONVERT(DATETIME,STUFF(STUFF(CAST(d.[start date] AS VARCHAR(8)),3,0,':'),6,0,':'),114),
[DTend date]...
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
June 24, 2013 at 6:34 am
Can you post the actual plan (not the estimated plan) for this batch, please?
-- Determine what is in the patch container
SELECT TOP(1000) DISTINCT M_SCNTYPE, M_FAMILY0, M_MLABEL0, M_SLABEL0, ContainerID = @TargetContainerID
INTO...
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
June 24, 2013 at 4:32 am
Jan Van der Eecken (6/21/2013)
Now why does this InlineTally function look so familiar? 😉
Same reason as Feynman diagrams are now so familiar, Jan 😉
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
June 21, 2013 at 2:31 am
ashwinboinala (6/20/2013)
i am getting this value from sysjobhistroy table from msdb there its in int format if u can give me solution where i can filter that table thats fine
SELECT...
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
June 20, 2013 at 9:27 am
You might need an input style for CONVERT:
;WITH Sampledata AS (
SELECT lastrundate = CAST(20130620 AS INT)
)
SELECT
lastrundate_INT = lastrundate,
lastrundate_CHAR8 = CAST(lastrundate AS CHAR(8)),
lastrundate_DATE = CONVERT(DATE, CAST(lastrundate AS CHAR(8)),112)
FROM Sampledata
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
June 20, 2013 at 9:25 am
Sean Lange (6/20/2013)
Is there a question here?
Yes there is, but not up there 😉
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
June 20, 2013 at 9:18 am
Venkata-433090 (6/19/2013)
Thanks for your response. Its kind of when the client retrieves the data.again, the 32 character count should start from where the pipe was placed.
Shouldn't take too much...
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
June 20, 2013 at 8:53 am
sagesmith (6/18/2013)
What I haven't seen is this "inverse relationship" i.e. where the rCTE fails to scale. Do you have an example?
The first article by Jeff Moden in your signature makes...
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
June 18, 2013 at 9:12 am
whenriksen (6/18/2013)
If "Show Actual Execution Plan" is set prior to executing the code and then both the queries (the CURSOR based one and the recursive CTE based one) are executed,...
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
June 18, 2013 at 8:53 am
sagesmith (6/18/2013)
ChrisM@Work (6/18/2013)
sagesmith (6/18/2013)
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
June 18, 2013 at 7:55 am
T.Ashish (6/18/2013)
While testing a query when we run it second time, it uses cache so performs better then previous run.
...
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
June 18, 2013 at 6:27 am
This appears to work:
SELECT
ID = ROW_NUMBER() OVER(ORDER BY MIN(DateRange)),
Employee, Job, [Workload],
StartDate = MIN(DateRange),
EndDate = MAX(DateRange)
FROM (
SELECT ID, Employee, Job, [Workload], DateRange,
Grouper = DENSE_RANK() over (order by...
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
June 18, 2013 at 6:17 am
sagesmith (6/18/2013)
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
June 18, 2013 at 6:13 am
Jonathan AC Roberts (6/18/2013)
insert into dbo.def (SeqNo, Date_Field, Payment)
SELECT A.Seqno, X.Date_Field, A.Payment
FROM dbo.abc A
CROSS APPLY (SELECT DATEADD(mm, T.N,...
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
June 18, 2013 at 3:58 am
dwain.c (6/17/2013)
ChrisM@Work (6/17/2013)
This runs about 4 times faster than the original against the sample data set.
SELECT
w.ID,
Wage = MIN(w.Wage),
Sector = MIN(w.Sector),
tw = MIN(a.tw)
FROM #WageData w
INNER...
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
June 18, 2013 at 3:31 am
Viewing 15 posts - 4,471 through 4,485 (of 10,143 total)