Forum Replies Created

Viewing 15 posts - 1,141 through 1,155 (of 4,080 total)

  • RE: cross join exclude data based on partial character of a data

    Are you editing your first post? If so, please don't. Just add new posts so others can follow what is happening.

    Looking at your...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: conditional table joins

    I would expect a "conditional join" to perform poorly.

    My suggestion would be to join to the table twice

    SELECT *

    FROM T1

    LEFT INNER JOIN T2 ...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: cross join exclude data based on partial character of a data

    You can test the rightmost two characters by using the RIGHT() function. In your example, try adding this to the WHERE clause.

    AND RIGHT(dbo_vwCourseClass.ClassTitle,2) <> RIGHT(dbo_vwCourseClass_1.ClassTitle,2)

    However, the solution above...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Are the posted questions getting worse?

    I finally took time to find this.... just for Jason.

    http://www.musicbuzzer.com/randy-newman/naked-man-video.html

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Finding maximum value out of 5 different columns

    Fastest performance. (One pass... No Sort Required)

    with cte (RowID,A,B,C,D,E) as

    (

    select 1,1,2,3,4,5 union all

    select 2,3,1,5,3,2 union all

    select 3,7,4,1,2,5

    )

    ,cte2 as

    (select *, case when A > B...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Finding maximum value out of 5 different columns

    Just for fun

    with cte (RowID,A,B,C,D,E) as

    (select 1,1,2,3,4,5 union all

    select 2,4,1,5,3,2 union all

    select 3,7,4,1,2,2

    )

    ,cte2 as

    (select RowID,CA.* from cte

    cross apply (values (cte.A),(cte.B),(cte.C),(cte.D),(cte.E)) CA (val)

    )

    ...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Get Errors When Columns Not In Table

    You're welcome, Doug. This may be the first time I've ever been thanked for saying "NO".

    Congratulations on making it happen with dynamic SQL. ...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Get Errors When Columns Not In Table

    The problem is that all statements are being checked against the table schema prior to the actual execution of the statements.

    Simply put, the above...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Are the posted questions getting worse?

    There are two types of people in this world.

    Those who can anticipate what's coming next.

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Are the posted questions getting worse?

    SOM

    Somebody remembered!

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: String addition - why does this not work?

    No problem, Mike. We all have moments like that.

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: String addition - why does this not work?

    It's working. You just can't see it with your print statement because you aren't trimming spaces from @X.

    Try this

    set @cmd = rtrim(@x) + ' '+ @y

    print @cmd

    P.S. ...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Are the posted questions getting worse?

    GilaMonster (6/1/2011)


    DBCC RunLikeHell

    DBCC MyEyesMyEyesIveGoneBlind

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Are the posted questions getting worse?

    May have to shut it for quite a long time too 😉

    However long it takes.

    Your running rhino icon looks naked, Jason.

    Would you consider changing your...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Are the posted questions getting worse?

    Insert your random cursors where you wish, change the variables and attach speech to the output.

    Shut the front door....

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

Viewing 15 posts - 1,141 through 1,155 (of 4,080 total)