Viewing 15 posts - 3,481 through 3,495 (of 10,143 total)
Sean Lange (3/28/2014)
dwain.c (3/28/2014)
Ville-Pekka Vahteala (3/27/2014)
Luis Cazares (3/27/2014)
I'm afraid that this database is full of these pieces of...
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
March 28, 2014 at 7:53 am
WayneS (3/27/2014)
Luis Cazares (3/27/2014)
I'm afraid that this database is full of these pieces of sh code and it's...
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
March 28, 2014 at 3:17 am
Luis Cazares (3/27/2014)
I'm afraid that this database is full of these pieces of sh code and it's slower...
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
March 28, 2014 at 3:11 am
Can you post the actual plan for the most recent 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
March 27, 2014 at 6:39 am
Have you tried resolving out the tables from the strings? Something like this:
SELECT * -- change to column name
INTO #OrgCommCode
FROM dbo.Fn_splitstrings(@p_OrgCommCode, ',')
SELECT * -- change to column name
INTO #CommCode
FROM dbo.Fn_splitstrings(@p_CommCode,...
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
March 26, 2014 at 7:31 am
You could replace four of those UNIONs with one:
SELECT *
FROM #tempac
UNION ALL
SELECT e.*
FROM ( -- e
SELECT
d.finyr,
d.minyr,
d.finmonno,
d.finmonname,
d.[activitytypeorder],
d.activitytype,
m.ha_code,
d.nhs_e_contract_id,
d.age_flag,
d.Number
FROM ( --...
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
March 25, 2014 at 8:17 am
joepacelli (3/19/2014)
The UPDATE looks like
You wouldn't believe how often folks have been caught out by omitting a seemingly inocuous bit of code from a query, only to find it's the...
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
March 25, 2014 at 7:52 am
Look up UPDATE...FROM in Books Online. There are examples which very closely match your requirement.
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
March 25, 2014 at 7:47 am
SQL Guy 1 (3/25/2014)
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
March 25, 2014 at 7:44 am
This is the finest example I’ve seen in a long time of how not to code against SQL Server.
Picking out single rows from one table at a time and...
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
March 25, 2014 at 4:07 am
Lynn Pettis (3/24/2014)
Also, it could just be me, but after downloading the estimated execution plan I was unable to open it.
Me neither, think it was truncated.
However: very high row...
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
March 24, 2014 at 10:54 am
Your GROUP BY eliminates the need for DISTINCT
SELECT --DISTINCT
s.site_number AS Site,
s.city AS City,
s.state AS State,
SUM(CASE WHEN hp.histConfID LIKE '%Generator$20Start$2fStop'
THEN CONVERT(DECIMAL(10, 2), h.numeric_value / 100 *...
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
March 24, 2014 at 9:12 am
tfendt (3/24/2014)
ChrisM@Work (3/24/2014)
tfendt (3/24/2014)
ChrisM@Work (3/24/2014)
NTILE(n) splits the data into n equal-sized partitions numbered 1 to n 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
March 24, 2014 at 9:00 am
tfendt (3/24/2014)
ChrisM@Work (3/24/2014)
NTILE(n) splits the data into n equal-sized partitions numbered 1 to n in a user-defined...
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
March 24, 2014 at 8:46 am
Have a look at the NTILE function in Books Online (SQL Server help).
NTILE(n) splits the data into n equal-sized partitions numbered 1 to n in a user-defined order and...
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
March 24, 2014 at 8:23 am
Viewing 15 posts - 3,481 through 3,495 (of 10,143 total)