Forum Replies Created

Viewing 15 posts - 1,201 through 1,215 (of 4,080 total)

  • RE: Are the posted questions getting worse?

    Jeff Moden (2/16/2011)


    WayneS (2/15/2011)


    Can anyone point me to a delimited split function that works on a varchar(max)? I know that Jeff's DelimitedSplit8K works on up to a varchar(8000), and I...

    __________________________________________________

    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: Return rows if total occurances exceeds 2 (combined with inner join)

    My first thought was I would like to see the difference in the execution plans. If I get time to do some tests I'll post...

    __________________________________________________

    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: Return rows if total occurances exceeds 2 (combined with inner join)

    First, you have to identify the set of userIDs which exist more than once.

    Try this:

    SELECT a.id,a.title,uao.userid

    FROM user_artist_owned uao

    INNER JOIN artists a on a.id=uao.objectid

    where userid in (

    SELECT userid

    FROM...

    __________________________________________________

    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: Pivoting Multiple Columns

    You should test them side by side to be sure, but in my experience the cross-tab runs just a hair faster on average.

    __________________________________________________

    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: Just closed the wrong page!

    Is this an SQL question?

    That is not a sarcastic remark. What are you running? What do you mean you "closed the page"? ...

    __________________________________________________

    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: Multiple UNION ALL queries cause SSMS to hang/freeze up/ slow down?

    It might be easier to follow if we could see the actual code, but....

    Remember that a CTE does not produce a temporary table. It is just a symbolic...

    __________________________________________________

    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 last 7 hours of data with 0's

    In the absence of a preexisting table, you can generate a sequential list of hours very simply by means of a tally table.

    ;with hoursTbl as (

    select dateadd(hour,N-1,cast('Feb 10 2011' as...

    __________________________________________________

    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?

    QA is where some developers send their code to see if it works correctly or not. Often they do this without verifying that it works in their development...

    __________________________________________________

    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: deduplication

    Just out of curiosity, how do you use ROW_NUMBER() at all without using OVER? I'll encourage you to read up on ROW_NUMBER(), RANK(), and the other windowed functions...

    __________________________________________________

    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: deduplication

    If you are using the code shown to insert into another table, you are only going to get one "duplicate" at a time. To insert all...

    __________________________________________________

    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: Table variable vs Temp table for approx 50000 records?

    akhandels (1/7/2011)


    Temporary data has only two columns -

    ID - int.

    CODE - varchar(40).

    CODE is used in join condition.

    If you index the table variable on [Code], and if the table to...

    __________________________________________________

    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: SELECT Highest Combination of Fields

    I am trying to find out what customer has the highest balance outstanding as well as the longest period outstanding.

    Mike, respectfully, you need to work on stating your question more...

    __________________________________________________

    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: Table variable vs Temp table for approx 50000 records?

    More information would help. What columns are you going to index on? What are your joins going to look like to your permanent tables?...

    __________________________________________________

    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-tab query

    LutzM (12/30/2010)


    The Dixie Flatline (12/30/2010)


    Good for you, Robert, and thanks for letting us know that you have a solution now. Good luck to you in the coming...

    __________________________________________________

    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-tab query

    Good for you, Robert, and thanks for letting us know that you have a solution now. Good luck to you in the coming year.

    One comment on 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

Viewing 15 posts - 1,201 through 1,215 (of 4,080 total)