Forum Replies Created

Viewing 15 posts - 14,566 through 14,580 (of 14,953 total)

  • RE: How can I Pass a Table variable in Stored Procedure?

    You really have two options for this currently. One is XML, the other is a delimited list.

    On any significant number of records, XML will be better. Yes, puting...

    - 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: Remove leading zeros and add spaces at the end

    Adam Haines (3/13/2008)


    There might be a single-update command for this, but I think it would be so incredibly complex, since it would have to determine how many zeroes there are...

    - 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: Need help with outer joins

    Glad to hear it worked out.

    - 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: Referencing aliased column in where clause

    You can do this in SQL 2005. Where, Having and Order By can all use the column alias from the Select clause.

    - 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: CTE Performance

    Joe, I haven't been able to work out an efficient way to use your nested sets structure on dynamic hierarchies. On relatively static data, it works great, but I...

    - 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: CTE Performance

    That's odd. I've tested CTEs vs loops on hierarchy data and ended up with slightly better performance in the CTE than the loop. Directly contradicts what you ended...

    - 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: Need help with outer joins

    Full join means include all rows from both tables. Cross join means include all combinations of rows from both tables.

    A full join has a key relationship between the tables....

    - 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: Need help with outer joins

    (As a side note, "Hall of Fame" and other such titles are ranks on this page, the name of the person writing the post is above that, in the pale...

    - 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: Remove leading zeros and add spaces at the end

    ALZDBA!! Thank you! I knew I was missing an easier way to do this.

    cast(cast(field as int) as char(15))

    That does the whole thing. (I knew my loop idea was...

    - 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: Need help with outer joins

    s gupta (3/13/2008)


    Thanks for the reply gsquared.

    The number of rows returned are correct... but somehow the count is messed up. I am trying to figure out why. The total number...

    - 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: Remove leading zeros and add spaces at the end

    The only way I can think of to do this is with a loop.

    while exists

    (select *

    from dbo.Table

    where Field like '0%')

    update dbo.Table

    set Field = right(field, len(field)-1) + ' '

    where Field like...

    - 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: Need help with outer joins

    select city.name as City, group.name as [Group],

    isnull(subqty.qty, 0) as Qty

    from dbo.City

    cross join dbo.Group

    left outer join

    (select cityid, groupid, count(*) as Qty

    from dbo.User

    where joindate >= @startdate

    and joindate < @enddate

    group by...

    - 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: Join table to it's self over and over and over....

    rbarryyoung (3/12/2008)


    GSquared (3/12/2008)


    Oh, and good Beatles references. 🙂

    Actually mine was from Month Python. :laugh:

    "Help me if you can, I'm feeling down

    and I do appreciate you're being 'round

    Help me get my...

    - 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: Backup Strategy - sanity check needed

    Differential backups are only useful if the prior full backup is good. So in the case we're discussing, where the full backup was lost, your differential backups would be...

    - 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: Linking to the Previous Row

    Seth (3/13/2008)


    I've had to link on a previous row in the past. I've just used self joins, i.e. joining a table on itself. In the join clause, I...

    - 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 - 14,566 through 14,580 (of 14,953 total)