Forum Replies Created

Viewing 15 posts - 346 through 360 (of 3,011 total)

  • RE: Query to find the start day of the week as Monday

    Lynn Pettis (12/4/2012)


    Michael Valentine Jones (12/4/2012)


    select

    a.*,

    Monday = dateadd(dd,(datediff(dd,-53690,a.DATE)/7)*7,-53690)

    from

    ( -- Test Data

    select [Date]= getdate()-2union all

    select [Date]= getdate()-1union all

    select [Date]= getdate()union all

    select [Date]= getdate()+1union all

    select [Date]= getdate()+2union all

    select [Date]= getdate()+3union all

    select [Date]=...

  • RE: Query to find the start day of the week as Monday

    select

    a.*,

    Monday = dateadd(dd,(datediff(dd,-53690,a.DATE)/7)*7,-53690)

    from

    ( -- Test Data

    select [Date]= getdate()-2union all

    select [Date]= getdate()-1union all

    select [Date]= getdate()union all

    select [Date]= getdate()+1union all

    select [Date]= getdate()+2union all

    select [Date]= getdate()+3union all

    select [Date]= getdate()+4union all

    select [Date]= getdate()+5union all

    select...

  • RE: problem inner joininig a derived column

    A calendar table is not really needed for this:

    select

    YearMonth = dateadd(mm,datediff(mm,0,[recorddate]),0),

    MyValueSum = sum([myvalue])

    from

    #a

    group by

    dateadd(mm,datediff(mm,0,[recorddate]),0)

    order by

    dateadd(mm,datediff(mm,0,[recorddate]),0)

    Results:

    YearMonth ...

  • RE: Alternative to a lock on an account balance check

    I would go with the approach of having the check in the update statement.

    Also, I would open the transaction in the stored procedure instead of the .net code and commit...

  • RE: Backing Up A 2TB Database

    ofg1983 (11/30/2012)


    Guys,

    Let me begin by stating, I am rookie when it comes to SQL, I am just starting to learn SQL and I apologize if this is a...

  • RE: Regulators, Mount Up

    TravisDBA (11/28/2012)


    It's not just unencrypted data that auditors ding you on nowadays. Wearing many hats at once and doing things outside your job description can definitely get you dinged as...

  • RE: Disaster Stories

    Probably not what you are looking for, but...

    http://en.wikipedia.org/wiki/1964_Philadelphia_Phillies_season

    "...The 1964 Philadelphia Phillies held a six and a half game lead in an exceptionally strong National League with 12 games to play....

  • RE: Restore DB backup from Enterprise Edition to Standard Edition

    chetanr.jain (1/10/2011)


    Team,

    i have my production database on SQL 2000 Enterprise Edition.

    Now to test one of the component, i need to restore the backup to another server. To save on...

  • RE: Suggestions to replace DBCC INDEXDEFRAG

    DKlein (11/26/2012)


    Thanks to all, we are organizing a transition from sql server '05 to sql server '12. I am going through maintenance jobs to prepare for the new version. I...

  • RE: SSD Lifetimes

    Jeff Moden (11/26/2012)


    Steve Jones - SSC Editor (11/26/2012)


    Jeff Moden (11/26/2012)


    Michael Valentine Jones (11/25/2012)


    I think they quote most mechanical disks with a MTBF of 1 million+ hours. I have to...

  • RE: Suggestions to replace DBCC INDEXDEFRAG

    DKlein (11/26/2012)


    We currently use DBCC INDEXDEFRAG to defrag indexes over 25% fragmentation. We are a 24/7 shop and I would need to replace it with a process that is 'online'...

  • RE: SSD Lifetimes

    Jeff Moden (11/26/2012)

    ...The writes are another thing caused simply by a lack of understanding of how to update data from one system to another. It involves mostly 2 large...

  • RE: SSD Lifetimes

    Jeff Moden (11/25/2012)


    FusionIO has listed 2 million hours and 6 years write endurance for their cards, ...

    Perhaps I'm reading something wrong but 6 years is only about 52,596 hours. ...

  • RE: SSD Lifetimes

    Jeff Moden (11/25/2012)


    Michael Valentine Jones (11/24/2012)


    The 400 GB drive on this link is rated a 35 PB of lifetime writes, so that would mean you could write 1 TB of...

  • RE: SSD Lifetimes

    For drives that are meant to be Enterprise Class, the lifetime should be long enough for almost any application.

    The 400 GB drive on this link is rated a 35 PB...

Viewing 15 posts - 346 through 360 (of 3,011 total)