Viewing 15 posts - 3,916 through 3,930 (of 10,143 total)
Probably the best tool for this is a dynamic cross-tab. Jeff Moden has an excellent article here[/url]. If after reading the article you are still having difficulty, post back.
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
December 4, 2013 at 6:43 am
dwain.c (12/3/2013)
Steve,I thought you might want to see this:
http://www.sqlservercentral.com/Forums/FindPost1519227.aspx
By alerting you, I am not vouching for its veracity.
Dwain, I thought some of that code looked familiar - didn't we mess...
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
December 4, 2013 at 6:23 am
Steve Jones - SSC Editor (12/2/2013)
L' Eomot Inversé (11/24/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
December 3, 2013 at 2:20 am
Here's the simplest way. Without further information it's unlikely to be the best.
-- I have an Employee table with Columns:
DROP TABLE #Employee
CREATE TABLE #Employee (EmpID INT IDENTITY(1,1), FirstName VARCHAR(100), MiddleName...
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
December 2, 2013 at 6:59 am
This is likely to be an expensive process whatever you do. What's the purpose?
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
December 2, 2013 at 6:43 am
Jeff Moden (11/29/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
December 2, 2013 at 2:57 am
Jeff Moden (12/1/2013)
ChrisM@Work (11/26/2013)
Jeff Moden (11/25/2013)
rlortega (11/25/2013)
So what minimum T-SQL skills are necessary if you're a DBA, not a developer?
To be honest... learning to read minds and to anticipate "what'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
December 2, 2013 at 1:53 am
Note that you don't need CTE N6:
DECLARE @startdate DATE, @enddate DATE
SET @startdate = '00010101'
SET @enddate = '99990101';
with
N0 as (SELECT 1 as n UNION ALL SELECT 1) -- 2...
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
November 29, 2013 at 7:09 am
Run the following code, query by query. If you're still unsure, post back.
WITH
N0 as (SELECT 1 as n UNION ALL SELECT 1) -- 2 rows
,N1 as (SELECT 1...
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
November 29, 2013 at 7:07 am
Jeff Moden (11/26/2013)
As a bit of a sidebar, I especially like the one about "make it work, make it fast, make it pretty" except you left off the 4th item...
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
November 28, 2013 at 2:02 am
Jeff Moden (11/25/2013)
rlortega (11/25/2013)
So what minimum T-SQL skills are necessary if you're a DBA, not a developer?
To be honest... learning to read minds and to anticipate "what's coming" by keeping...
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
November 26, 2013 at 6:35 am
If your hierarchy is likely to remain consistent then this may be more efficient than a rCTE:
DROP TABLE #Entity
CREATE TABLE #Entity (EntityId INT, EntityTypeId INT, Description VARCHAR(100), ParentEntityId INT)
INSERT 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
November 25, 2013 at 7:10 am
Lynn Pettis (11/20/2013)
sunil.mvs (11/20/2013)
Thanks Chris ...The solution is as expected.. but need to check performance .
Thanks
Surya Sunil
You should also make sure you understand how...
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
November 21, 2013 at 6:27 am
Here's a simple islands'n'gaps solution as suggested by Koen:
DROP table #temp
CREATE table #temp (SysKey int ,BusName varchar(9) ,BusType varchar(6) ,StartDateKey int ,EndDatekey int )
Insert into #temp (SysKey ,BusName,BusType,StartDateKey,EndDatekey)
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
November 20, 2013 at 6:58 am
sathiyan00 (10/8/2013)
with Improved SQL 8K “CSV Splitter” Function its taking around 25 sec
with xml its taking around 30sec
with substring its...
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
October 8, 2013 at 8:09 am
Viewing 15 posts - 3,916 through 3,930 (of 10,143 total)