Viewing 15 posts - 3,226 through 3,240 (of 5,504 total)
Your verbal description is not really telling me what you're trying to do.
Please provide table def, sample data, expected result and what you've tried so far in a ready to...
June 30, 2010 at 2:22 pm
One option would be to wrap your example inside a cte and use a conditional conversion in an outer query (using CASE statement).
If you'd like to see a coded version...
June 30, 2010 at 2:18 pm
torpkev (6/29/2010)
I was pretty close in what I had but wasn't quite there.. and the link on dynamic cross tab sounds pretty interesting - i'll...
June 29, 2010 at 4:54 pm
Here's a code snippet that should get you started.
If you have variable Departments you might want to consider using the DynamicCrossTab approach. If you're not familiar with it you...
June 29, 2010 at 3:23 pm
gideon.kahl (6/28/2010)
Wayne's solution above is by far the most efficient of...
June 29, 2010 at 10:36 am
WayneS (6/28/2010)
lmu92 (6/28/2010)
The first person who "forced" me to do it actually created...
June 29, 2010 at 10:25 am
Will one of the following queries get you started?
SELECT *
FROM msdb..sysjobactivity
SELECT *
FROM msdb..sysjobhistory
SELECT *
FROM msdb..sysjobs
June 28, 2010 at 4:07 pm
WayneS (6/28/2010)
lmu92 (6/28/2010)
@Wayne: any specific reason not to use the VARCHAR(8000) version (aka dbo.DelimitedSplit8K) in this case?
Lutz, I'm just giving you a chance to show a better approach. 😀
Seriously, I...
June 28, 2010 at 3:54 pm
Jeff Moden (6/28/2010)
Except for the fact that I'm generally against using INT to store ISO dates, there's no need to change it here because it won't help for this particular...
June 28, 2010 at 3:35 pm
Ok, you've done the first step already (create a query using fake table names).
The next step would be to post the fake table DDL and the insert scripts for the...
June 28, 2010 at 3:20 pm
Jason Messersmith (6/28/2010)
There is no gain with using Count(*), yup everything is running on an index
Can you post the create index script for the related index?
June 28, 2010 at 2:45 pm
Using Dans ready to use sample data I'd go with the following solution:
SELECT ServerName,PartNum, PF
FROM
(SELECT PartNum,ServerA,ServerB,ServerC,ServerD
FROM @t) p
UNPIVOT
(PF ...
June 28, 2010 at 2:34 pm
@Wayne: any specific reason not to use the VARCHAR(8000) version (aka dbo.DelimitedSplit8K) in this case?
And I second bteraberry: The other approaches are known as listed under "not recommended". 😉
June 28, 2010 at 2:22 pm
Any particular reason for not using COUNT(*)?
But more interestingly: is there any index available supporting the WHERE clause?
If not, can you change it to benefit from an existing index (e.g....
June 28, 2010 at 2:15 pm
Sounds like homework to me...
If so, you should show us what you've tried so far and where you get stuck.
We might be able to give you a hint towards the...
June 28, 2010 at 2:07 pm
Viewing 15 posts - 3,226 through 3,240 (of 5,504 total)