Viewing 15 posts - 5,251 through 5,265 (of 10,143 total)
vinu512 (2/7/2013)
--Creating Table
Create Table Ex1
(
Id Int Identity(1,1),
AllLevels Varchar(MAX)
)
--Inserting Sample...
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
February 7, 2013 at 6:25 am
carlosaamaral (2/7/2013)
to 200,000 lines is very, very slow ..... :crying:
to 1 line, it's good ...
I will continue using 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
February 7, 2013 at 3:51 am
demonfox (2/7/2013)
ChrisM@Work (2/7/2013)
demonfox (2/7/2013)
...updating column1 to column1; definitely not a good idea...
There was a thread covering exactly this, fairly recently. I'll try to track it down. IIRC the conclusion (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
February 7, 2013 at 2:59 am
demonfox (2/7/2013)
...updating column1 to column1; definitely not a good idea...
There was a thread covering exactly this, fairly recently. I'll try to track it down. IIRC the conclusion (for most folks)...
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
February 7, 2013 at 2:46 am
GilaMonster (2/5/2013)
Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.
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
February 7, 2013 at 2:25 am
~nano (2/7/2013)
I had this frustrationg error on a query as well, all though the dataset I was using for a join didnt even contain anything other than numbers.
I got...
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
February 7, 2013 at 2:01 am
DougG (2/6/2013)
if a previous WHEN...
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
February 7, 2013 at 1:36 am
ALI100 (2/6/2013)
SetFormattedValue =CASE
When rg.ReferredFieldType='NUM'
Then CAST(#PointedMslValues.Value AS NUMERIC(18,cAST(rg.ReferredDecimalPoints) )
more cases .
END
I am generating a dynamic query which is giving error actually it...
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
February 7, 2013 at 1:23 am
greg.bull (2/7/2013)
Regards, Greg.
PS I often get called...
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
February 7, 2013 at 1:14 am
saxena200 (2/6/2013)
@chris-2PFA the execution Plan...
this is not working.... 🙁
Apologies, I missed a column from the GROUP BY:
SELECT DT.MO_OF_YR_NM ...
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
February 6, 2013 at 8:31 am
saxena200 (2/6/2013)
@chris-2PFA the execution Plan...
this is not working.... 🙁
You commented out the query hint. Can you run it without the query hint commented out, 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
February 6, 2013 at 8:14 am
Like this?
SELECT
t.*,
x.*,
y.*,
z.*
FROM (SELECT Target = 100) t
CROSS APPLY (
SELECT
DataValue = CAST(t.[Target] AS DECIMAL(15,4)),
DataType = 'C'
) x
CROSS APPLY (
SELECT vcDataValue = CONVERT(VARCHAR(20),x.DataValue,1)
) y
CROSS APPLY (
SELECT FormattedData...
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
February 6, 2013 at 7:01 am
DougG (2/6/2013)
No good.Same error on the final cross apply.
When I comment out the last cross apply, I do get results for t, x, and y.
Have another read of Scott'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
February 6, 2013 at 6:39 am
Try using APPLY for prototyping this. When you're done, converting to an inline function is little more than copy & paste:
SELECT
t.*,
x.*,
y.*,
z.*
FROM PSBPR_Tree t
CROSS APPLY (
SELECT
DataValue =...
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
February 6, 2013 at 6:20 am
DougG (2/6/2013)
ChrisM@Work (2/6/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
February 6, 2013 at 6:01 am
Viewing 15 posts - 5,251 through 5,265 (of 10,143 total)