Forum Replies Created

Viewing 15 posts - 2,461 through 2,475 (of 4,080 total)

  • RE: Imoprt xml file to sql server 2005 table

    Truly, you are the man, Flo. 😉

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: row_num/rank over date dimension table

    HAH! I was right!! (cruel chuckle)

    The DENSE_RANK solution adds a sort and segment to the execution plan, so the DATEDIFF solution runs twice as fast...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: row_num/rank over date dimension table

    Isn't DENSE_RANK going to force a sort?

    declare @startDate datetime

    set @startDate = '11/1/2009'

    select DATEDIFF(month,0,@startdate)-1317 -- this datediff calculation is the solution

    -- proof

    ;with tally (N) as (select row_number() over(order by id)...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: row_num/rank over date dimension table

    PARTITION BY means to start counting all over again from 1 when this value changes. It isn't required.

    Try this:

    ,row_number() over (ORDER BY day_date)

    But, if you have one...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: exclude between

    AND property.number 500

    First off, you shouldn't be getting ANY rows back based on that criteria. Yet another reason we ask to see actual code.

    You can rewrite it...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: TRIGGERS

    Here is an example that just logs the first names instead of emailing them, but you should get the idea.

    You didn't mention whether or not you might...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Are the posted questions getting worse?

    Starts tomorrow for me, 2AM precisely.

    Presenting or attending, Gail?

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Arithmetic overflow

    Whups

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Arithmetic overflow

    Good luck with your 2 a.m. presentation, Gail.

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Arithmetic overflow

    Kruti:

    CONVERT is unecessary if the target is large enough, and won't help if it isn't.

    -- this will fail

    declare @source int

    declare @target numeric (6,2)

    set @source = 35677

    set @target = CONVERT(numeric(10,2),@source)

    select 'Example...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Best practice for passing multiple values into stored procedure

    When you get to 2008, you will also be able to pass table variables as input parameters. However, we have a lot of code that parses strings...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: How to optimize the processing speed

    Sure hope you're feeling better, Barry. If not now, then soon.

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: How to optimize the processing speed

    select * from #test b

    where b.id= (select max(id) from #test t

    ...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: How to optimize the processing speed

    For starters, I'd like to know which steps are taking the most time. If you are doing a table scan of a zillion large rows, that could...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: TRIGGERS

    The trigger will always fire, and will only fire, when an INSERT takes place. You will have to put logic within the trigger to test for the other conditions,...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

Viewing 15 posts - 2,461 through 2,475 (of 4,080 total)