Forum Replies Created

Viewing 15 posts - 1 through 15 (of 22 total)

  • RE: Comparing Dates

    Most notable quote: "And screw the boss... it's not his/her hiney"

  • RE: Comparing Dates

    I Agree

  • RE: Need query

    Jeff, I have to disagree please see the example below:

    Your reebar example does not include the filter nid = nid. Also note, on smaller queries the optimizer will pull all...

  • RE: How to Handle Non additive measures

    Try LastNonEmpty and such. What are you using the non-additive measure for?

  • RE: Need query

    Dugi (12/24/2009)


    I agree with you ... if you SELECT NAME FROM T-SQL_MASTERS WHERE NAME LIKE 'J%' you will retrieve the only result Jeff Moden.

    Let's not forget Jamie Thomson http://sqlblog.com/blogs/jamie_thomson/

  • RE: returning multiple rows from multiple tables to multiple columns in one row

    I don't know what you're asking, but try the PIVOT command. If the rows you want to convert to columns are dynamic you may need to execute a dynamic sql...

  • RE: Best way to delete or not as the case may be...

    insert the records you want to save into a temporary table, drop and recreate the table in question, then insert the records from the temporary table into the newly created...

  • RE: High reads when Inserting single value

    Ok so we are back to indexes being the likely cause issue. IMO it sounds like a page split. Make sure the fillfactor and pad_index are not set too high....

  • RE: Query

    I agree with a slight modification if the EndDate is exclusive:

    Logically you want all results from the table but only list results when the start date is before 'xx/xx/xxxx' and...

  • RE: Need query

    The question was not clear by any means. Additionally, the second example does not have a logical relationship that holds true for Start Date, End Date and TotalDays.

  • RE: High reads when Inserting single value

    That sounds like a good explanation and would likely have a much greater impact on the insert performance.

  • RE: Need query

    declare @start_date datetime

    declare @end_date datetime

    declare @diff int

    set @start_date = '3/9/2009'

    set @end_date = '3/13/2009'

    set @diff = datediff(dd,@start_date,@end_date)

    create table #Results ([Month Start] datetime, [Month End] datetime, [Total Days] int, [Amount] money)

    insert into...

  • RE: High reads when Inserting single value

    you can find what indexes are on the table by using sp_helpindex 'tablename'

    If indexes are the issue you can use profiler to monitor queries to the table and drop indexes...

  • RE: table structure for faster result??

    try an index defrag.

    Also when you do your simple queries do the following:

    check the db for locks (sp_who)

    include appropriate filters on argable fields

    return limited results

    select top 1 id from table...

  • RE: CTE and With

    Some people don't know how to write queries, or use there limited knowledge to complete a task (likely cause in this scenario).

    I like to look at CTE's at temporary views....

Viewing 15 posts - 1 through 15 (of 22 total)