Viewing 15 posts - 2,161 through 2,175 (of 10,143 total)
WayneS (9/24/2015)
SELECT activityNameFROM #Activities
CROSS APPLY (SELECT PATINDEX('[A-Z,a-z][0-9]%', activityName),
...
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
September 24, 2015 at 7:39 am
SELECT activityName, SortOrder = x4.LeftChars + x6.NewRightNums + ' ' + x3.RightPart
FROM #Activities
CROSS APPLY (SELECT SpacePos = CHARINDEX(' ',activityName+' ')) x1
CROSS APPLY (SELECT LeftPart = LEFT(activityName,x1.SpacePos-1)) x2
CROSS APPLY (SELECT RightPart...
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
September 24, 2015 at 7:13 am
jkramprakash (9/24/2015)
i want to delete this records .
In this below example i want to delete all the records
which...
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
September 24, 2015 at 6:44 am
Is there any particular reason for storing the email address as NVARCHAR?
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
September 24, 2015 at 6:07 am
vipin_jha123 (9/24/2015)
;with cte AS (SELECT [ProgramId]
,[ProgramVersionId]
,[WRINPrefix]
...
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
September 24, 2015 at 5:30 am
Here's how you do it:
SELECT
s.*,
[ForecastDate] = DATEADD(DAY, x.n, s.ForecastStartDate)
FROM #STG s
CROSS APPLY (
SELECT TOP(1 + DATEDIFF(DAY, s.ForecastStartDate, s.ForecastEndDate))
n = -1 + ROW_NUMBER() OVER(ORDER BY (SELECT NULL))
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
September 24, 2015 at 2:29 am
squvi.87 (9/24/2015)
Declare @var varchar(100)set @var = '2000'
select case when ISDATE(@var ) =1 then 'Valid Date' when ISDATE(@var ) =0 then 'Invalid Date' END
In the above code 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
September 24, 2015 at 1:52 am
steve.tarry (9/22/2015)
drop table ##ssselect 3 as nr, 'a' as kar, 1 as groupingcode into ##SS
insert into ##SS values
(9, 'C',1),
(15,'h',1),
(7, 'e',1),
(6, 'd',1),
(12,'z',1),
(4, 'b',1),
(5, 'q',1)
select * from ##SS
--
-- Get the first...
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
September 22, 2015 at 8:08 am
Plenty of scope for optimisation here - and the faster a batch completes, the less likely it is to cause a deadlock. I'd start with the nested cursor. Resolve your...
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
September 22, 2015 at 7:11 am
There's a couple of references to the 64/65 split in this article by Paul White. I'm sure I've seen something more comprehensive somewhere but the Google - force eludes me...
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
September 22, 2015 at 4:11 am
Brandie Tarvin (9/21/2015)
Eirikur Eiriksson (9/20/2015)
Is anyone memory optimized?😎
Not me. But now that I've seen that thread, I am curious.
IIRC Paul White has one or two articles which exploit...
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
September 21, 2015 at 4:44 am
Rod at work (9/11/2015)
Ed Wagner (9/11/2015)
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
September 11, 2015 at 9:56 am
Walton (9/11/2015)
I will try to replace NOT IN with LEFT JOIN and filtering out with left column of left table IS NOT NULL. It had helped me in many cases.
Have...
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
September 11, 2015 at 8:50 am
mohelsheikh (9/9/2015)
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
September 11, 2015 at 7:19 am
BL0B_EATER (9/11/2015)
I had to google JET, never heard of it.
Somewhere in Oxfordshire innit?
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
September 11, 2015 at 1:46 am
Viewing 15 posts - 2,161 through 2,175 (of 10,143 total)