Viewing 15 posts - 511 through 525 (of 1,228 total)
Nige.
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
July 2, 2012 at 1:05 pm
Satnam Singh (6/28/2012)
I am having a serious performance problem with the below query:
SELECT DATEADD(mi, (SELECT BiasInMinutes FROM A WHERE ...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
June 28, 2012 at 3:14 am
SELECT whatever
FROM table
WHERE [field]=@var
UNION ALL
SELECT whatever
FROM table
WHERE @var = 'A' and field = 'B'
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
June 26, 2012 at 1:06 pm
dwain.c (6/22/2012)
dwain.c (6/22/2012) Did you check to see if this solution is any faster?
To answer my own question:
CPU...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
June 25, 2012 at 12:14 am
There's a simple solution for this. Anyone remember the challenge of obtaining every possible combination of the letters of the alphabet, starting A, AB, AC.....BC, BD, BE......ABCDEFGHIJKLMNOPQRSTUVWXYZ....ZY, ZZ?
Generate instead a...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
June 19, 2012 at 3:40 pm
Hi Les
Good challenge, top work. One question: sooner or later someone will post a solution and you will have to test it. Will you use your sample data set or...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
June 19, 2012 at 12:23 pm
Have you tried a VALUES list? With CROSS APPLY?
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
June 14, 2012 at 10:28 am
Stueyd (6/13/2012)
I've just been handed a database to look at and it's horrible <<snip>>
You don't know what happens if you drop an index covering a pk? Try it 😉
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
June 13, 2012 at 11:00 am
There are a few uses of rCTE's in this thread;
http://www.sqlservercentral.com/Forums/FindPost1202081.aspx
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
May 6, 2012 at 2:46 am
Jeff Moden (3/25/2012)
ChrisM@home (3/25/2012)
SELECT TOP (ISNULL(DATALENGTH(@pString),0)) n = n1+n2+n3+n4
FROM (((VALUES (0),(100),(200),(300),(400),(500),(600),(700),(800),(900)) t2(n2)
CROSS...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
March 25, 2012 at 10:36 am
the sqlist (3/24/2012)
Sometimes it is better to keep the things simple in terms of solution and not to think about the effects...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
March 25, 2012 at 2:02 am
Jeff Moden (3/24/2012)
....
Seems like a lot more work than necessary. Wouldn't a modification for 2008 of Itzik Ben-Gan's original code be a little more eye-ball friendly not to mention...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
March 25, 2012 at 1:11 am
the sqlist (3/24/2012)
...I think we should not be worried about how many rows are actually generated...
I couldn't disagree more. When you're looking at an overall time of 25ms per run...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
March 24, 2012 at 11:40 am
the sqlist (3/23/2012)
I'm lost here. What's wrong with what I posted above?
select
n
from
(
SELECT n = (n1 + n2 + n3 + n4)
FROM (((VALUES (0),(100),(200),(300),(400),(500),(600),(700),(800),(900)) t3 (n3)
CROSS JOIN (VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9))...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
March 24, 2012 at 1:17 am
Used as a function:
CREATE FUNCTION [dbo].[DelimitedSplit8K_CTE]
--===== Define I/O parameters
(@pString VARCHAR(8000), @pDelimiter CHAR(1))
RETURNS TABLE WITH SCHEMABINDING AS
RETURN
WITH Splitter AS (
SELECT...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
March 23, 2012 at 2:49 pm
Viewing 15 posts - 511 through 525 (of 1,228 total)