Forum Replies Created

Viewing 15 posts - 43,456 through 43,470 (of 59,063 total)

  • RE: Using sp_executesql to create dynamic sql

    Using QUOTENAME will pretty much put the kabosh on SQL Injection. But, I agree... if it's not used in a public facing environment, there's not much need for the...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: Clustered Primary key index on INT column or on a date column

    Lynn Pettis (6/10/2009)


    If your date queries are range based, then the clustered index on the date column may be worthwhile. Remember, the clustered index is the order in which...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: Are the posted questions getting worse?

    lmu92 (6/10/2009)


    It's not that hard to generate sample data - but it's time consuming.

    It's a lot less time consuming than putting it into an excel spreadsheet, attaching the file, and...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: Mining for Quitters

    GSquared (6/10/2009)


    BUT, in a company with thousands of employees, can top management, or even upper middle management, actually get to personally know every employee?

    Absolutely agreed. I didn't say they...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: Mining for Quitters

    GSquared (6/10/2009)


    So, in other words, no human anywhere should use any tool for anything, because it will cause the loss of responsibility and "the human touch".

    I don't believe anyone even...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: Mining for Quitters

    Mad Hacker (6/10/2009)


    Although I was initially receptive to this idea, I've about decided that the benefit(s) may not outweigh the costs. Although it sounds like a great idea on...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: Random problems

    drogers (6/10/2009)


    Uh, why would you "not agree with the idea that RAND() doesn't work like NEWID() in T-SQL." Do you find the discrepancy "unexpected?" 😀

    Heh... Only the first time...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: O(n) , O(n log n), O(n^2)

    RBarryYoung (6/9/2009)


    Jeff Moden (6/9/2009)


    O(wtf2) 😉

    Heh. Hey, I'm not the one who asked the question, I'm just trying to answer them.

    Oh no... sorry, Barry. Wasn't directed at anyone in...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: Random problems

    Mike C (6/9/2009)


    Jeff Moden (6/9/2009)


    Mike C (6/9/2009)


    Another minor quibble - each instance of RAND() is invoked once per query.

    SELECT RAND(), RAND()

    Generates two different random numbers because RAND() is actually called...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: Mining for Quitters

    Steve Jones - Editor (6/9/2009)


    I agree with you, Jeff, but who do you talk to? I've known plenty of people that were thinking of leaving, and wouldn't want to let...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: Week numbers and week start dates

    balars_2000 (6/9/2009)


    I would display 0's to indicate there was no data during that particular week.

    --Ta

    Then you need a complete list of dates to join against for any given year...

    [font="Courier New"]DECLARE @FirstDate DATETIME

     SELECT @FirstDate = '20090104'

     SELECT v.Number AS Week,

            DATEADD(wk, v.Number   ,@FirstDate) AS StartDate,

            DATEADD(wk, v.Number+1 ,@FirstDate) AS NextDate

       FROM Master.dbo.spt_Values v

      WHERE Type = 'P' 

        AND Number BETWEEN 0 AND 51[/font]

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: Help Needed ???

    Heh... no, I had the right post.

    No one has correctly defined what the "first ten" will be. Without something to do an ORDER BY in the data, all...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: Help Needed ???

    Sorry... wrong post.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: Sort by Reads or Ratings

    Jason Crider (6/9/2009)


    How difficult would it be to have a section for scripts that would allow you to do a sort by rating, reads, or date? What about the same...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: Mining for Quitters

    Obviously not directed at Steve... this type of thing is a big steaming pile of hooie. Everyone thinks they can figure out humans with numbers and stats. Try...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 15 posts - 43,456 through 43,470 (of 59,063 total)