The Random Rows

  • Comments posted to this topic are about the item The Random Rows

  • I have to disagree with the answer here.  If you run the code more than once, it comes up with the same 10 rows.  Therefor, they are NOT "random rows". 😉

     

     

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

  • "This table has the BusinessEntityID as the PK"

    Well that would have been nice to know!

  • It's the well known AdventureWorks database. All tables have PKs in there.

  • I too disagree with the answer, but for another reason:

    Without a table definition, there is no way of knowing that the BusinessEntityID column is a primary key column (not everyone has a solid memory of all table definitions of the AdventureWorks database).

    There really is no way to determine the values without this bit of information. Granted that assumptions can be made based on the term "ID" in the column name, but yeah... those are assumptions.

    "My gosh! It's full of [SELECT] stars!"
  • The question says AdventureWorks. This is a public schema.

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply