Forum Replies Created

Viewing 15 posts - 136 through 150 (of 1,155 total)

  • RE: Troubleshooting Query

    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...

  • RE: How to get HIT RATIO

    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...

  • RE: Beginner => create multiple count in a query !

    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...

  • RE: How to get HIT RATIO

    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 *...

  • RE: Beginner => create multiple count in a query !

    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...

  • RE: Troubleshooting Query

    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...

  • RE: Beginner => create multiple count in a query !

    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...

  • RE: Find Only Yesterday's Orders?

    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. 🙂

  • RE: macaddr to bigint

    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...

  • RE: whats wrong in the Order By Clause

    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...

  • RE: sp_Msforeachdb

    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...

  • RE: sp_Msforeachdb

    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...

  • RE: in and not in question

    This is similar and may in some cases work faster:

    SELECT a.id

    FROM tblA a

    LEFT OUTER JOIN tblB b

    ON b.id =...

  • RE: Looking for Method to Script Object Permissions

    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...

  • RE: Find Only Yesterday's Orders?

    I like Antonio method more than the one I posted because it reduces the additional overhead of converting dates.

Viewing 15 posts - 136 through 150 (of 1,155 total)