Viewing 15 posts - 2,476 through 2,490 (of 2,610 total)
If you are using a recursive CTE then you will need a to have a UNION ALL.
DECLARE @EmpId int
SET @EmpId = 5
;WITH CTE AS
(
SELECT *
...
May 3, 2012 at 3:40 am
We use SAN with massive amounts of memory installed on them. This seems to be a whole different kettle of fish. The bottlenecks move from the disk to other areas...
May 1, 2012 at 4:16 am
michal.lisinski (4/2/2012)
Jonathan AC Roberts (4/2/2012)
michal.lisinski (4/2/2012)
SELECT DISTINCT CustomerID
FROM [#Purchase]
WHERE (ProductCode IN ('A','B')) AND (CustomerID NOT IN
...
April 2, 2012 at 7:32 am
michal.lisinski (4/2/2012)
SELECT DISTINCT CustomerID
FROM [#Purchase]
WHERE (ProductCode IN ('A','B')) AND (CustomerID NOT IN
...
April 2, 2012 at 6:31 am
codebyo (3/29/2012)
One question though:
Wouldn't the query below present the same results?
SELECT
CustomerId
FROM Purchase
WHERE ProductCode IN ('A','B', 'C')
GROUP BY CustomerID
having sum(case when ProductCode = 'C' then 1 else 0...
March 29, 2012 at 8:35 am
mister.magoo (3/29/2012)
Great Spackle, thanks!
In my tests, using your code to build a million row test, I found this method to be twice as fast for the same logical reads.
SELECT...
March 29, 2012 at 7:10 am
Just to end arguments over performance I tried this:
DECLARE @StartTime datetime
DECLARE @x int
DECLARE @y varchar(20)
DECLARE @MaxIterations int
SET @MaxIterations = 10000
SET @StartTime = GETDATE()
DECLARE @i int
SET @i = 0
WHILE @i <...
March 13, 2012 at 10:17 am
mtassin (3/13/2012)
andrew.diniz (3/13/2012)
Apart from rCTE's scaling linearly, this statement is not correct. Read Jeff's article. A table, however large or small, will always perform many times faster than a rCTE.
That's...
March 13, 2012 at 9:59 am
Jeff Moden (3/13/2012)
Jonathan AC Roberts (3/13/2012)
Peformance won't be an issue./code]
Comparatively speaking, it's a large issue especially if someone uses it for something else, Jonathan. Please see the following article...
March 13, 2012 at 9:02 am
For the purpose of displaying 12 values the use of a recursive CTE is fine. Performance won't be an issue. You are using the CTE to generate numbers 1 to...
March 13, 2012 at 4:59 am
drew.allen (3/5/2012)
Jonathan AC Roberts (3/5/2012)
drew.allen (3/5/2012)
Jonathan AC Roberts (3/5/2012)
Create a function to split a string into a table:
The original question was about taking multiple values and storing them in a...
March 5, 2012 at 11:03 am
Sean Lange (3/5/2012)
Jonathan AC Roberts (3/5/2012)
drew.allen (3/5/2012)
Jonathan AC Roberts (3/5/2012)
Create a function to split a string into a table:
The original question was about taking multiple values and storing them in...
March 5, 2012 at 9:38 am
drew.allen (3/5/2012)
Jonathan AC Roberts (3/5/2012)
Create a function to split a string into a table:
The original question was about taking multiple values and storing them in a single variable, not doing...
March 5, 2012 at 9:30 am
What is it sorted on? The minimum rule number it satisfies?
March 5, 2012 at 8:48 am
Create a function to split a string into a table:
GO
CREATE FUNCTION [dbo].[SplitString] (@list nvarchar(MAX), @separator nvarchar(MAX) = ';')
RETURNS @table TABLE (VALUE nvarchar(MAX))
AS
BEGIN
DECLARE @position int
...
March 5, 2012 at 8:17 am
Viewing 15 posts - 2,476 through 2,490 (of 2,610 total)