Viewing 15 posts - 1,441 through 1,455 (of 10,143 total)
richardmgreen1 (6/30/2016)
Thanks for that.
So I'd just just APPLY/LEFT JOIN as normal?
As for the linked server, I have to for now.
We're upgrading some servers to SQL2012 and then going 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
June 30, 2016 at 4:36 am
Treat it as any other tablesource, fashionably APPLY.
Are you really running this query against a linked server?
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 30, 2016 at 4:25 am
WITH _Tally AS (
SELECT n = ROW_NUMBER() OVER(ORDER BY (SELECT NULL))
FROM (VALUES (0),(0),(0),(0),(0),(0),(0),(0),(0),(0)) d1 (n),
(VALUES (0),(0),(0),(0),(0),(0),(0),(0),(0),(0)) d2 (n)
)
SELECT
t.ID,
x.FromDate,
x.ToDate
FROM @tbl t
CROSS APPLY (SELECT YearBoundariesCrossed = DATEDIFF(YEAR,t.Fromdate,t.Todate)) w
CROSS...
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 30, 2016 at 2:27 am
tindog (6/29/2016)
ChrisM@Work (6/29/2016)
tindog (6/29/2016)
ChrisM@Work (6/29/2016)
tindog (6/29/2016)
ChrisM@Work (6/29/2016)
tindog (6/29/2016)
Now Wales are after independence from England to 'safeguard' their future...despite the fact that they also voted in favour of Brexit :w00t:
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 29, 2016 at 4:15 am
tindog (6/29/2016)
ChrisM@Work (6/29/2016)
tindog (6/29/2016)
ChrisM@Work (6/29/2016)
tindog (6/29/2016)
Now Wales are after independence from England to 'safeguard' their future...despite the fact that they also voted in favour of Brexit :w00t:
The Welsh aren't like...
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 29, 2016 at 3:57 am
tindog (6/29/2016)
ChrisM@Work (6/29/2016)
tindog (6/29/2016)
Now Wales are after independence from England to 'safeguard' their future...despite the fact that they also voted in favour of Brexit :w00t:The Welsh aren't like us humans.
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
June 29, 2016 at 3:39 am
tindog (6/29/2016)
Now Wales are after independence from England to 'safeguard' their future...despite the fact that they also voted in favour of Brexit :w00t:
Texas, New Hampshire and California are getting uppity...
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 29, 2016 at 3:22 am
tindog (6/29/2016)
Now Wales are after independence from England to 'safeguard' their future...despite the fact that they also voted in favour of Brexit :w00t:
The Welsh aren't like us humans.
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 29, 2016 at 3:21 am
Bwahaaahaaaa! Made my day Luis thanks for posting this!
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 29, 2016 at 1:32 am
narayanamoorthy.a (6/28/2016)
So is it a problem with the code ?
Not really - it's a problem with the image datatype. It's been deprecated and will be removed in a future version...
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 28, 2016 at 9:28 am
Luis Cazares (6/28/2016)
ChrisM@Work (6/28/2016)
Just a thought - try this mod:
AVG(CAST(datalength(embedded_data) AS BIGINT))
More like this:
AVG(datalength(CAST(embedded_data AS varbinary(MAX))))
However, the image data type length can fit in an int.
From BOL for...
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 28, 2016 at 9:27 am
Just a thought - try this mod:
AVG(CAST(datalength(embedded_data) AS BIGINT))
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 28, 2016 at 9:09 am
select count(*), avg(datalength(embedded_data)) from task_attach where id_task_user = NEWID()
AVG_BIG()?
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 28, 2016 at 9:05 am
Just to recap, when you run the third query, this one:
-- checkin
select count(*), avg(datalength(embedded_data)) from task_attach where id_task_user in (
select id
from task_user
where task_type = 2
and date_begin >= CAST(CAST(DATEADD(DAY,-180,GETDATE())...
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 28, 2016 at 9:00 am
Brandie Tarvin (6/28/2016)
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 28, 2016 at 8:57 am
Viewing 15 posts - 1,441 through 1,455 (of 10,143 total)