Viewing 15 posts - 1,966 through 1,980 (of 8,731 total)
Grumpy DBA (10/27/2016)
djj (10/27/2016)
crookj (10/27/2016)
Ed Wagner (10/26/2016)
Revenant (10/26/2016)
Grumpy DBA (10/26/2016)
Ed Wagner (10/26/2016)
HighLow
Lowlands
Scotland
FREEDOM!
Slavery
Lincoln
Cadillac
October 27, 2016 at 9:23 am
Here's an example of the different behavior of ROUND and CEILING/FLOOR.
WITH SAMPLE_DATA (SD_ID,SD_VAL,SD_EXPECTED) AS
(
SELECT 1, 0.1, 30 UNION...
October 27, 2016 at 8:58 am
Quick correction.
WITH SAMPLE_DATA (SD_ID,SD_VAL,SD_EXPECTED) AS
(
SELECT 1, 0.1, 30 UNION ALL
SELECT 1, 10.1, 30...
October 27, 2016 at 8:47 am
Ed Wagner (10/26/2016)
Phil Parkin (10/26/2016)
Any clairvoyants here today?
I admit that's very tempting, but I don't want to get drawn into a battle of sarcastic remarks that have nothing to do...
October 26, 2016 at 12:39 pm
That's right, you need to replace the zeros with the columns available.
To obtain the data in the new way (which should be the correct way to store it) you need...
October 26, 2016 at 9:44 am
Actually, it's not precisely a cross tabs issue, but some kind of unpivoting.
Here's an example which is partially explained in this article: http://www.sqlservercentral.com/articles/CROSS+APPLY+VALUES+UNPIVOT/91234/
SELECT [Customer], [Section], [Data], [Year], Jan, Feb, Mar,...
October 26, 2016 at 8:24 am
Is this Oracle? :crazy:
October 26, 2016 at 8:02 am
Deries (10/26/2016)
October 26, 2016 at 7:55 am
Here's a bit simpler version of DesNorton's query.
SELECT MT.CaseID, MA.MinDate, MinDateCol = MA.ColName
FROM @datetest AS MT
OUTER APPLY (
SELECT TOP(1) VA.ColName, VA.DateCol
FROM (VALUES('MTDThresholdDate', MT.MTDThresholdDate),
...
October 26, 2016 at 7:50 am
Why do you want to store the data 24 times?
You can achieve the result without having all that data stored. It's just a waste of storage when a query will...
October 26, 2016 at 7:35 am
Now, that's weird. Have you tried reseeding the identity value?
I'd post the syntax but I'm on my phone right now.
October 25, 2016 at 3:11 pm
DesNorton (10/25/2016)
Luis Cazares (10/25/2016)
The reason for the CTE was to include the ORDER BY which isn't available in the simple UPDATE.
The correct covering index also takes care of the order...
October 25, 2016 at 1:20 pm
Phil Parkin (10/25/2016)
Luis Cazares (10/25/2016)
And with a single statement and the error...
October 25, 2016 at 1:15 pm
However, the OUTPUT clause will generate an empty result set when no rows are updated, so that should work.
And with a single statement and the error handling just throwing the...
October 25, 2016 at 12:51 pm
The reason for the CTE was to include the ORDER BY which isn't available in the simple UPDATE.
October 25, 2016 at 12:42 pm
Viewing 15 posts - 1,966 through 1,980 (of 8,731 total)