Forum Replies Created

Viewing 15 posts - 196 through 210 (of 627 total)

  • RE: How do I initialise a sql variable to 0 in stored-procedure ?

    Smendle (9/22/2016)


    How to initialise a sql variable to 0 in stored-procedure which would work both in SQLServer 2005 & 2008 ?

    The part I bolded above provides a default value...

  • RE: sp_spaceused not working. Any ideas

    Depending on what version of SQL you are using you can use the 'oneresultset = 1' parameter.

    That being said I do believe that is a fairly recent change. You...

  • RE: Are the posted questions getting worse?

    ChrisM@Work (9/6/2016)


    Sean Lange (9/6/2016)


    Luis Cazares (9/6/2016)


    Sean Lange (9/6/2016)


    I tried my hand at curing my own bacon for the first time. It came out of the cure Saturday morning and hit...

  • RE: Today's Random Word!

    whereisSQL? (9/6/2016)


    Hugo Kornelis (9/6/2016)


    Ray K (9/6/2016)


    Ed Wagner (9/6/2016)


    djj (9/6/2016)


    Ed Wagner (9/6/2016)


    Hugo Kornelis (9/6/2016)


    Stuart Davies (9/6/2016)


    BWFC (9/6/2016)


    TomThomson (9/6/2016)


    Revenant (9/5/2016)


    Treat

    Trick

    Cheap

    Canary

    Wharf

    Worf

    Data

    Riker

    Island

    Beach

    Volleyball

    Top Gun

  • RE: Joining tables with sub-queries and count

    Looks like you are having a problem with the "Similar_Call" column but I'm not sure exactly what you are trying to accomplish...or at least your logic.

    I've broken part of the...

  • RE: Are the posted questions getting worse?

    WayneS (8/29/2016)


    jasona.work (8/29/2016)


    Brandie Tarvin (8/29/2016)


    Well my thought is that there are many people who are absolutely terrified of interviews, who don't see themselves doing well no matter what they actually...

  • RE: Today's Random Word!

    ZZartin (8/25/2016)


    Ray K (8/25/2016)


    crookj (8/25/2016)


    Ed Wagner (8/25/2016)


    Alan.B (8/25/2016)


    BWFC (8/25/2016)


    Prefect

    day

    Night

    Stalker

    Talker

    Dead

    Walking

  • RE: Seconds to hours??

    This seems too easy so maybe I don't understand but if you merely want to convert seconds to hours you can just do something like this.

    DECLARE @seconds INT = 29732

    SELECT...

  • RE: Today's Random Word!

    Grumpy DBA (8/23/2016)


    Ed Wagner (8/23/2016)


    Kaye Cahs (8/23/2016)


    Revenant (8/22/2016)


    whereisSQL? (8/22/2016)


    Antacid

    Tums

    Chalk

    Blackboard

    Blackbeard

    Pirate

  • RE: SQL to sum last 12 month values from same table

    DuncEduardo (8/23/2016)


    yes, if you don't mind. I'm doing a few other things and had to put this aside.

    If you can post some DDL and Sample Data that would be very...

  • RE: Today's Random Word!

    Kaye Cahs (8/16/2016)


    djj (8/16/2016)


    Ed Wagner (8/16/2016)


    whereisSQL? (8/16/2016)


    The Dixie Flatline (8/16/2016)


    ThomasRushton (8/16/2016)


    whereisSQL? (8/16/2016)


    Grumpy DBA (8/16/2016)


    djj (8/16/2016)


    Rocket

    Richard

    Canada

    Dry

    Martini

    Cherry

    Peach

    Apple

    Tart

    Pop

  • RE: Today's Random Word!

    Manic Star (8/15/2016)


    HappyGeek (8/15/2016)


    Luis Cazares (8/15/2016)


    whereisSQL? (8/15/2016)


    Revenant (8/15/2016)


    Ray K (8/15/2016)


    Ed Wagner (8/15/2016)


    djj (8/15/2016)


    Grumpy DBA (8/15/2016)


    djj (8/15/2016)


    Ed Wagner (8/15/2016)


    Sweet

    Treat

    Trick

    Joke

    Puzzle

    Jigsaw

    Tools

    Power

    Unlimited

    Opportunities

    Scam

    Spam

  • RE: How to query a crosstab

    Y.B. (8/11/2016)


    It's not a dynamic solution but something like this gets the output you want.

    SELECT o.[Date], o.OrderID, x.ProdID, o.QTY, x.Category

    FROM #Crosstab c

    UNPIVOT (

    Category FOR [Date] IN ([01/08], [02/08], [03/08], [04/08])

    )...

  • RE: I Need to Keep a Running Total From Two Columns

    This gave me the results you were looking for.

    SELECT item, RType, FMonth, FYear, Qty,

    SUM(QTy) OVER (PARTITION BY item ORDER BY FYear, FMonth) AS TotalQty

    FROM TestData

    WHERE RType = '2.Supply'

    UNION...

  • RE: How to query a crosstab

    It's not a dynamic solution but something like this gets the output you want.

    SELECT o.[Date], o.OrderID, x.ProdID, o.QTY, x.Category

    FROM #Crosstab c

    UNPIVOT (

    Category FOR [Date] IN ([01/08], [02/08], [03/08], [04/08])

    ) x

    JOIN...

Viewing 15 posts - 196 through 210 (of 627 total)