Viewing 15 posts - 136 through 150 (of 1,155 total)
So my index in my county table should be the state_code? I really can't think of what I would index in my States table since it just lists each state...
April 4, 2008 at 9:36 am
You query is correct...
You need to look through the dmv sys.dm_os_performance_counters, to see what you want to calculate. It is pretty much all there. You can use the...
April 4, 2008 at 9:22 am
There really is not a better way to achieve this, with simple joins. I can give you the break down on derived tables, as they can be very very...
April 4, 2008 at 8:53 am
You can also add the join back. The main thing is you have to remove the object_name in the where clause as this is not always consistent.
SELECT (a.cntr_value *...
April 4, 2008 at 8:35 am
Your join is a 1 to many and is skewing your original results. Try using a derived table.
SELECT p.person_id AS Idpersonne,
SUM(CASE f.actif...
April 4, 2008 at 8:21 am
I guess I must be missing the meaning of index. In my county table I have 1 column called County_Id (primary key, unique identifier), another column with the actual county...
April 4, 2008 at 8:02 am
sum(case f.actif when 0 then 0 end) as NbActifFalse
This will always be 0 becuase you are summing zero. If you change it to the code below it should...
April 4, 2008 at 7:30 am
Why not just use
WHERE
DATEDIFF(day,processdate,getdate()) = 1
Good post. To answer the question of why I say, the simplest solution is usually the least apparent. 🙂
April 3, 2008 at 10:15 am
This was also posted in the TSQL forums. It is always benifical to place your post in one spot. This way you have all your answers/responses in one...
April 3, 2008 at 10:06 am
kindly tell me whats wrong with this query and y not 4/1/2008 shows after the 3/31/2008
Is it because 4/1/2008 is not in your result set? Or is this...
April 3, 2008 at 9:58 am
All right I did a litte more testing and it seems we need to double up the quotes in the dynamic sql. You need to have 4 single quotes...
April 2, 2008 at 10:13 pm
This main piece of your code does not make sense to me because there is no need to do subqueries if you are returning all aggregated data. Your query...
April 2, 2008 at 9:00 pm
This is similar and may in some cases work faster:
SELECT a.id
FROM tblA a
LEFT OUTER JOIN tblB b
ON b.id =...
April 2, 2008 at 8:23 pm
William,
There are a lot more options in 2005 than you believe. You can click tools --> Options --> Scripting and set a whole slew of options. Among these...
April 1, 2008 at 7:35 pm
I like Antonio method more than the one I posted because it reduces the additional overhead of converting dates.
April 1, 2008 at 11:11 am
Viewing 15 posts - 136 through 150 (of 1,155 total)