Forum Replies Created

Viewing 15 posts - 18,811 through 18,825 (of 59,072 total)

  • RE: Omitting 'DISTINCT'

    sql_only (12/25/2015)


    I have the following code which is returning the required result, however I think I am coding it wrong because it runs really slow on large data-sets and 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: Merry Christmas

    For a more Yellow star (although terribly washed out thanks to transparency)...

    DECLARE @g TABLE (g GEOMETRY, ID INT IDENTITY(1,1));

    -- Adjust Color

    INSERT INTO @g(g) SELECT TOP 29 CAST('POLYGON((0 0,...

    --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: Merry Christmas

    annjunk (12/25/2015)


    Thanks! That is nice. I understand polygons with geometry, but can you please explain how you set the colors? Also, did you add the FROM sys.messages...

    --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: How to use 'like' in a query

    ScottPletcher (12/25/2015)


    Since Transaction_Date contains the time, a query coded like this:

    Activity.Transaction_Date BETWEEN '20151130' and '20151201'

    Would return rows from 12/01/2015 at exactly midnight (if there were any). But that wouldn't...

    --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: How to reduce Huge Log File size

    ScottPletcher (12/25/2015)


    Jeff Moden (12/24/2015)


    You've confused me a bit, Scott. First you say that 16 VLFs for a 1GB logfile is too low and then you explain using even fewer...

    --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: The Most Common Query Blunders...

    I believe my favorite non-SARGable problems are due to the inappropriate use of "OR" and things like the following...

    WHERE ISNULL(SomeNumericColumn,0) > 0

    ...

    WHERE ISNULL(SomeCharacterColumn,' ') > '...

    --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: LEAP and LAG behind the scenes

    Jason A. Long (12/25/2015)


    Jeff Moden (12/25/2015)


    Jason A. Long (12/25/2015)


    Come to think of it, I had planned to write an article about creating an insanely fast "Working Days" iTVF I built...

    --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: The Most Common Query Blunders...

    Jason A. Long (12/25/2015)


    Jeff Moden (12/25/2015)


    Here's one thing that you should talk about... not subscribing to the absolute belief in "best practices" even if millions of people subscribe to a...

    --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: The Most Common Query Blunders...

    Jason A. Long (12/25/2015)


    Ed Wagner (12/25/2015)


    This certainy isn't a comprehensive list, but I think it's a decent start.

    While loops or cursors instead of set-based alternatives

    Non-SARGable predicates

    Multi statement table valued functions

    Using...

    --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: The Most Common Query Blunders...

    Jason A. Long (12/25/2015)


    Ed Wagner (12/25/2015)


    This certainy isn't a comprehensive list, but I think it's a decent start.

    While loops or cursors instead of set-based alternatives

    Non-SARGable predicates

    Multi statement table valued functions

    Using...

    --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: An Impressive SQL Server

    Ed Wagner (12/25/2015)


    Anders Pedersen (12/25/2015)


    Since the article was reposted...

    Two of the largest credit charge clearing systems runs on SQL, and has for a long time. The first time I...

    --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: Number VS Letter

    Basurmanin (12/25/2015)


    take it easy

    First, I agree... as frustrating as questions with seemingly unwarranted restrictions go, people need to "Take it Easy".

    You can help diffuse such responses. People...

    --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: LEAP and LAG behind the scenes

    Jason A. Long (12/25/2015)


    Come to think of it, I had planned to write an article about creating an insanely fast "Working Days" iTVF I built a few months back...

    Now THAT...

    --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: The Most Common Query Blunders...

    Ed Wagner (12/25/2015)


    Kevin, just the way you phrased "bad-data causers" made me think of the horrible offense of storing dates and times in string columns.

    Or, like MS did in MSDB,...

    --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: Best way to merge two large client databases

    It's most likely because I've never had to do such a thing but I don't know of any tool designed to do something like this. There are tools like...

    --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 - 18,811 through 18,825 (of 59,072 total)