Forum Replies Created

Viewing 15 posts - 1,126 through 1,140 (of 3,544 total)

  • RE: Output Clause and Identity_Insert

    You must supply the (PrimaryKey) column list as well ie

    SET IDENTITY_INSERT BackupDatabase..TableA ON

    DELETE

    FROM PrimaryDatabase..TableA

    OUTPUT Deleted.PrimaryKey

    INTO BackupDatabase..TableA (PrimaryKey)

    WHERE 1=1

    SET IDENTITY_INSERT BackupDatabase..TableA OFF

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Using IDENTITY or handling it your own?

    The only time I use my own incrementing instead of IDENTITY is when the business demands no gaps (ie caused by failed inserts with IDENTITY)

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Stock Aging Query

    When you state 'for some items' are you using 41 (stock) for all items or did you substitute each item's stock for the literal 41.

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Are the posted questions getting worse?

    Dave Ballantyne (4/6/2011)


    Any other threadzian going to be at sqlbits ?

    Yarp, Saturday.

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Stock Aging Query

    WITH a ([Item Code],A,B,C,D) AS (

    SELECT [Item Code],

    SUM(CASE WHEN DaysDiff BETWEEN 0 AND 30 THEN [Trx Qty] ELSE 0 END) AS [A],

    SUM(CASE WHEN DaysDiff BETWEEN 31 AND 60 THEN...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Sorting Multiple Columns

    Do you have multiple rows per ID?

    Otherwise the Salary column in the sort is irrelevant.

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Are the posted questions getting worse?

    Grant Fritchey (4/6/2011)


    Our Starblazers

    Thunderbirds Are Go

    Hey, Hey, we're The Monkeys

    I'll add two:

    Jonny Quest

    Space Ghost

    How about

    Fleegle, Bingo , Drooper and Snork 😀

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Are the posted questions getting worse?

    CirquedeSQLeil (4/5/2011)


    Steve Jones - SSC Editor (4/5/2011)


    GSquared (4/5/2011)


    Just the other day, someone was telling me that, "If you'd lived through the Reagan years ...", without realizing I lived through "the...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Are the posted questions getting worse?

    Stefan Krzywicki (4/5/2011)


    David Burrows (4/5/2011)


    Stefan Krzywicki (4/5/2011)


    ...What are you doing, standing around on people's lawns?

    Nah, bet he plays Knock-down Ginger :w00t:

    I have no idea what that means.

    http://en.wikipedia.org/wiki/Knock,_Knock,_Ginger

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Are the posted questions getting worse?

    Stefan Krzywicki (4/5/2011)


    ...What are you doing, standing around on people's lawns?

    Nah, bet he plays Knock-down Ginger :w00t:

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Are the posted questions getting worse?

    WayneS (4/4/2011)


    ... in return please do not pick on my next question coming up I think on April 12th or 13th

    Deal! (But you have to not moan or groan about...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Looping a select statement to return one table

    I corrected my posted code for type 6.

    You have a problem with your query, your end times are not accurate enough ie

    you should be using 14:29:59.997 not 14:29:00.000

    it would be...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Looping a select statement to return one table

    I think it is the data you posted.

    The file has 534 rows whereas the total of your counts comes to 773.

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Looping a select statement to return one table

    Ah OK now I see, my bad, got the Shift numbers wrong.

    Your change was close but CASE statements check in the order the WHEN is specified, so the test for...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Looping a select statement to return one table

    First, you changed the CASE statement for Shift Why? This would be why the results do not match.

    Second I may have missed a bit of logic in one of your...

    Far away is close at hand in the images of elsewhere.
    Anon.

Viewing 15 posts - 1,126 through 1,140 (of 3,544 total)