Forum Replies Created

Viewing 15 posts - 9,976 through 9,990 (of 14,953 total)

  • RE: TSQL help needed

    Bob Hovious (4/13/2009)


    Gus, I rewrote your function as an inline table valued function and it gets the job done in half the time of the ConcatMaxTest function, but still three...

    - 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: TSQL help needed

    Jeff Moden (4/13/2009)


    I can almost guarantee that there will always be 50,000 distinct SomeInts on the million row test. And, although the SomeLetters2 column is pretty random, the average...

    - 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?

    Jeff Moden (4/13/2009)


    GSquared (4/13/2009)


    CLR does a faster running total than the quirky update too.

    As we've known for quite some time, SQL just plain isn't good at what it isn't designed...

    - 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: Conditional Selection of Column

    You're on the right track, but what you need is "Case When Else". Look up Case in Books Online, it's got samples, syntax, etc.

    - 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?

    CLR does a faster running total than the quirky update too.

    As we've known for quite some time, SQL just plain isn't good at what it isn't designed for. It'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: should this t-sql raise error?

    You can't create a view on tables that don't exist. Won't work. You need to create the tables first, then create the view.

    - 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: TSQL help needed

    Just for one more test, I took the type and value functions out of the XML version of the UDF, and that took it down to 6.5 seconds CPU and...

    - 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: TSQL help needed

    Just to test it a bit further:

    CREATE FUNCTION dbo.ConcatXMLTest (@SomeInt_in INT)

    RETURNS VARCHAR(8000)

    AS BEGIN

    RETURN (SELECT

    ...

    - 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: TSQL help needed

    Jeff, in your posted test harness, you need to rename the functions in the final tests. It has "SELECT SomeInt, dbo.ConcatTest...", but it needs to be Concat8kTest and ConcatMaxTest,...

    - 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?

    GilaMonster (4/11/2009)


    Bob Hovious (4/11/2009)


    Okay... how many people here advocate the use of GOTO statements in T-SQL?

    I do, solely for error handling in SQL 2000. Since there isn't a TRY-CATCH construct...

    - 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: Trying to separate a name field into two columns

    Ruby:

    What I'm going to suggest is use a simple split, then select all rows where you end up with a space in the first or last name, after it's been...

    - 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: Trying to separate a name field into two columns

    Todd:

    I just looked at the name parser at SQLTeam that you linked to. It's a useless toy. You have to enter the format codes for each name. ...

    - 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: Trying to separate a name field into two columns

    Barry:

    Where did you get using 0 in parsename? I'd never seen that before, and it's not in BOL for 2k5, so I tried this:

    select parsename('gus.gwynne',0)

    Result is null. Put...

    - 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 SP result

    Try using this to delete dupes. It's MUCH faster.

    ;with Dupes (Row) as

    (select

    row_number() over

    (partition by Project,PLC,CP_Bill_Hours

    order by Project,PLC,CP_Bill_Hours)

    from #temp_Report2)

    delete from Dupes

    where Row > 1;

    This assumes you're using...

    - 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: store proc

    What error message does the second problem give you?

    - 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 - 9,976 through 9,990 (of 14,953 total)