Forum Replies Created

Viewing 15 posts - 4,201 through 4,215 (of 14,953 total)

  • RE: Can this be converted to a set based query?

    Here's an initial take on it. It doesn't quite make sense, because the sub-queries don't seem to tie directly to the outer queries.

    This version is only one step better...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: Can this be converted to a set based query?

    Sorry, "partition", with reference to a running total or other aggregate, simply means to break the data down into subsets. If, for example, you had multiple orders on a...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: TEMP DB remains huge

    Microsoft says you really can't shrink tempdb online. You either need to restart, or put the server in single-user mode at the least.

    You've probably already seen this, but here's...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: Maint Plan Fails When Taking Database(s) Offline

    Maintenance plans do have a problem with that. That's one of the important reasons to move away from them as much as you can, and use more intelligent scripts...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: Can this be converted to a set based query?

    It looks to me, from what I can see in the code, that the primary issue you are running into is a running total calculation that has to be performed...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: Does anyone know why this wouldn't work?

    You're welcome.

    Are you absolutely possitive that under no circumstances will an update ever be done one more than one row, that you will need to send this e-mail on?

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: Looking for Work in SQL Server

    Jake Shelton (5/29/2011)


    GSquared (5/27/2011)


    Jake Shelton (5/26/2011)


    I'm quite happy now Jan, don't get me wrong, BUT....just because I've moved on from the poor experience that doesn't mean I forget it. ...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: Tally Table vs. While Loop

    jarid.lawson (5/27/2011)


    I'm getting stuck on how to script the tally version. This is what I have come up with, but so far it's a no go.

    Declare @TableName Varchar(128),

    @FieldName...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: Whats the benefits to clustering

    Active/Passive, all you can legally do is use the passive as a failover if the active goes down (intentionally or by failing). That's why you don't have to pay...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: Are the posted questions getting worse?

    A friend of mine says that what a friend of his does is buy old clunker cars, usually for around $2,000 or so. Then the only maintenance he does...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: Tally Table vs. While Loop

    It depends on what you want to do.

    If, for example, you want to perform a set of update/delete/insert actions based on iterative needs, then a Tally/Numbers table can do it...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: Does anyone know why this wouldn't work?

    This bit will throw an error if there's more than one row:

    (SELECT end_date FROM DELETED) IS NULL

    AND (SELECT [status] FROM INSERTED) = 'S'

    Here's a test I ran:

    CREATE TABLE dbo.TestR...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: create variable name???

    I'd recommend using an ANSI/ISO standard date format for it, so the files sort naturally. So it would be 20110527, not 27052011.

    You can do that like this:

    declare @String varchar(50);

    set...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: Does anyone know why this wouldn't work?

    Not on the default schema, maybe? Or accidentally in the wrong database on one or the other connection?

    As an aside, the way the trigger is written will throw an...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: Are the posted questions getting worse?

    Stefan Krzywicki (5/27/2011)


    GSquared (5/27/2011)


    ALZDBA (5/27/2011)


    GilaMonster (5/27/2011)


    Elliott Whitlow (5/26/2011)


    Jan Van der Eecken (5/26/2011)


    GilaMonster (5/26/2011)


    One very uncomfortable PM sent...

    From the posts the person has made, they are totally out of their depth....

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

Viewing 15 posts - 4,201 through 4,215 (of 14,953 total)