Viewing 15 posts - 871 through 885 (of 1,838 total)
I'm not sure I understand why you added the line:AND V3.VariableID IN (64,65,66,67,68);
July 11, 2017 at 12:30 pm
OK, given these requirements, and knowing that there are potentially multiple versions of the Yes/No variables as well, maybe something like this:SELECT DocumentID, VariableID, ValueText, RevisionNo
...
July 11, 2017 at 10:21 am
July 10, 2017 at 2:56 pm
If RV.RevisionNo is needed in the results, just include it in both halves of the UNION ALL query in the CTE. I didn't have a dbo.Documents table in the testing...
July 10, 2017 at 2:12 pm
Are the disks directly attached to the server or are they on a SAN? If the files are located on a SAN then splitting things out into separate logical drives...
July 10, 2017 at 1:27 pm
Are we really OCD? Or is it CDO... keeping the letters in their proper alphabetical order 😉
July 10, 2017 at 12:58 pm
July 10, 2017 at 12:46 pm
I had to invent my own data to try this, so it's not well tested, but maybe something like this:WITH VarYesNo AS
(SELECT V.DocumentID, V.VariableID, V.ValueText, CAST(1...
July 10, 2017 at 11:55 am
I might see a problem in your subquery for V2, I'm thinking it probably should include DocumentID in the SELECT and GROUP BY, and in the JOIN. It might make...
July 7, 2017 at 8:31 am
I think the example query you provided accidentally swapped VariableID and ValueText columns in your PIVOT clause. You probably want:PIVOT
(
MAX (ValueText)
FOR VariableID IN
(...
July 7, 2017 at 7:45 am
Does SQL Server provide a simple easy way to test stored procedures and functions? ...
July 7, 2017 at 7:17 am
I think a part of the problem is the way people approach it. When I work with developers, they already have preconceived notions coming into a design session of what...
July 7, 2017 at 6:59 am
I almost fell for Extended Attributes, but did guess the right answer. I think that page of my memory might have been pushed out by the least recently used algorithm
July 7, 2017 at 6:22 am
Can you give an example of what you were comparing for windowed function compared to select group by approach? Is there an index on the windowed function's PARTITION BY and...
July 6, 2017 at 10:54 am
When I try running this query after SET STATISTICS IO ON, it shows logical reads but not physical reads, even for a server that hasn't been logged into today. How did...
July 6, 2017 at 10:30 am
Viewing 15 posts - 871 through 885 (of 1,838 total)