Viewing 15 posts - 76 through 90 (of 859 total)
Traditional approach:
SELECT c.Customer, o.*
FROM dbo.Customers AS c
INNER JOIN dbo.Accounts AS a
ON c.ID = a.CustomerID
INNER JOIN dbo.Orders AS o
ON a.ID = o.AccountID
WHERE c.Inactive = 0
AND...
November 27, 2012 at 4:11 pm
Looking at the original query it is very de-normalized and almost looks like a pivot table in its own right so the first thing i did to accomplish the task...
November 27, 2012 at 3:52 pm
I will try to work something up but with out sample data it will take a little longer as i will need to generate some. As far as aggregating...
November 27, 2012 at 2:51 pm
I would recommend reading Jeff Moden's Cross tab and Pivot articles. Number 1 is http://www.sqlservercentral.com/articles/T-SQL/63681/
November 27, 2012 at 12:01 pm
ill add a little of my view to sean's. in an OLTP (Transaction) system i would say it would be very limited where i would de-normalize, i would not...
November 27, 2012 at 11:59 am
Great sample data. i have a question, how do you know there will only be 12 ExternalID's? is that a business rule. how will you deal with...
November 26, 2012 at 5:05 pm
is the code you posted generating the alerts or what you are running to find the blocking every 3 min? if its one or the other the other half...
November 26, 2012 at 4:55 pm
ScottPletcher (11/26/2012)
Also, with a reasonably well-tuned tempdb, you should strongly consider using the:
SORT_IN_TEMPDB = ON
option....
November 26, 2012 at 4:49 pm
so am i.
a little more detail on what you are trying to accomplish will be very helpful here.
November 26, 2012 at 1:14 pm
same concept as the total rows except instead of sum and you would use a second column variable to dynamically create column1 + column2 ... then instead of using a...
November 19, 2012 at 6:07 am
Vedran Kesegic (11/17/2012)
November 17, 2012 at 7:58 am
i think this will be very help full for you. it seems like you are an accidental dba and this book is a greate guide to trouble shooting. ...
November 17, 2012 at 7:53 am
Here is some sample data so i could chew on it. i would suggest looking at DelimitedSplit8k for this, the link is in my signature or you can find...
November 16, 2012 at 1:38 pm
Raastarr (11/15/2012)
DATEADD(DD,DATEDIFF(DD,0,GETDATE()),3650))
and this now allows me to extend the working pattern forwards, as I...
November 15, 2012 at 6:18 am
I would Suggest using a CTE to hold the pivot table then select your data and union it to a totals query.
This will get you close, i changed your dynamic...
November 14, 2012 at 4:20 pm
Viewing 15 posts - 76 through 90 (of 859 total)