Viewing 15 posts - 1 through 15 (of 311 total)
Error code 5 usually means 'Access is...
February 22, 2017 at 7:39 am
With 4 rows as test input, the number of scans and logical reads are a little bit meaningless. The version with the persisted CTE ColumnValues resulted in 17 scans (1...
February 17, 2017 at 1:08 pm
Just another idea. Unpivot the columns you want to compare and count the number of ID pairs. At least it makes it easier to add more columns to compare.
February 17, 2017 at 12:10 pm
Sorry, I thought the comma separated list was a requirement. If you just want a set of (set_id, product_id) replace
SELECT DISTINCT
set_id,
STUFF((
...
December 22, 2016 at 10:32 am
I also started with a recursive CTE but it never came to an end. A cursor seems to be reasonably fast in this case. On my laptop your script runs...
December 22, 2016 at 9:35 am
You have to test it yourself if it performs better, but here's simplified alternative:
SELECT
Q.memid,
Q.EffectiveDate,
Q.termdate,
...
December 8, 2016 at 7:48 am
stevennjuki (12/23/2015)
...Hi,
The number of rows fetched is to be determined by parameter!
Ok, here's a more dynamic version:
DECLARE @NumberOfRows INT = 4; -- Must be between 1 and 100
WITH Numbers AS...
December 23, 2015 at 5:17 am
Not very dynamic, but here's an attempt. How many rows do you expect for the lowest two dates?
SELECT
ca.n, t.cl_t, t.cl_a,
CASE ca.n
...
December 23, 2015 at 12:37 am
According to the 2014 documentation (http://msdn.microsoft.com/en-us/library/dd207007.aspx) this feature was added in SQL 2008. I didn't know of this feature either.
July 24, 2014 at 5:59 am
http://msdn.microsoft.com/en-us/library/dd207007(v=sql.105).aspx
If you have BOL installed, just lookup '\' in the index.
July 24, 2014 at 4:51 am
You could use a single query like below. I have not tested it against a 4.5 million row input set, but it's probably faster then the loop and all the...
July 23, 2014 at 4:48 am
Like this?
SELECT
O.[Locale] [@locale],
(SELECT
I.[Key] as 'ContentId',
I.[Value] as 'Content'
FROM
CreateXML I
...
February 25, 2014 at 2:46 am
ChrisM@home (8/6/2013)
Peter Brinkhaus (8/6/2013)
azdeji (8/6/2013)
Both SQL codes work perfectly!Thanks Peter Brinkhaus and ChrisM@home
Strange, because my solution gives an entirely different result then the solution of Chris
Oh Peter, my humblest apology....
August 6, 2013 at 1:38 pm
azdeji (8/6/2013)
Both SQL codes work perfectly!Thanks Peter Brinkhaus and ChrisM@home
Strange, because my solution gives an entirely different result then the solution of Chris
August 6, 2013 at 12:10 pm
ChrisM@home (8/6/2013)
Peter Brinkhaus (8/6/2013)
Something like this?...
Check out the last 20 rows of your result set, Peter.
What's wrong with it? Based on the sample data presented, especially
...
11
12
13
13
13
...
I concluded that each number...
August 6, 2013 at 12:09 pm
Viewing 15 posts - 1 through 15 (of 311 total)