Forum Replies Created

Viewing 15 posts - 16,831 through 16,845 (of 59,067 total)

  • RE: Random Unique Number Always

    amy26 (9/14/2016)


    Thank you so much! Perfect!

    Curiosity question please. Which method did you use?

    --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 Unique Number Always

    Eirikur Eiriksson (9/14/2016)


    Jeff Moden (9/14/2016)


    Eirikur Eiriksson (9/13/2016)


    First few rows of the output (wich obviously will not be the same again)

    Not guaranteed to be true, though. Because of the translations,...

    --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: Add million of records

    sqlenthu 89358 (9/14/2016)


    Hi all, I have to transfer around 50 million records from one table to another. What should be the best approach. I know it can be done batchwise...

    --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: recovery mode comparison

    The nest questions would be.... do you have anything in the database that you couldn't easily recreate and are you backing up the database on a very regular basis.

    --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: Split a string on Commas - except when it has a numeric character immediately on either side of it

    Best way to fix this is to have a pork chop dinner with the people that are providing the data. 😉

    --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: Convert Columns to Rows

    dallas13 (9/14/2016)


    Once again Thanks a lot.

    Jeff- I understand your concern but we have data coming from third party so we have to massage data here.

    The Dixie Flatline- You are right....

    --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: Convert Columns to Rows

    dallas13 (9/14/2016)


    Thanks a lot guys. However I tried this approach

    CREATE TABLE #UnPivotExample(code varchar(2), value int)

    INSERT INTO #UnPivotExample (code,value)

    SELECT code,value

    FROM

    (SELECT [AZ], [NY], [PA] FROM #Example

    ) AS cp

    UNPIVOT

    ...

    --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 Unique Number Always

    Eirikur Eiriksson (9/13/2016)


    First few rows of the output (wich obviously will not be the same again)

    Not guaranteed to be true, though. Because of the translations, as unlikely as it...

    --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: Convert Columns to Rows

    Jason A. Long (9/13/2016)


    Try this...

    IF OBJECT_ID('tempdb..#Example','U') IS NOT NULL

    DROP TABLE #Example;

    CREATE TABLE #Example (

    id INT,

    AZ INT NULL,

    NY INT NULL,

    PA INT NULL

    );

    GO

    INSERT#Example (id,AZ,NY,PA) VALUES (1, '5','7','5'),(2, '2','3','5'),(3, '3','2','5');

    SELECT

    e.id,

    x.State,

    x.Value

    FROM

    #Example e

    CROSS...

    --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 for dynamic partitioning of table sql server

    Thanks, Steve. I really appreciate the time you took to explain that. You folks definitely put some thought into 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: Random Unique Number Always

    amy26 (9/13/2016)


    Hello, I have a stored procedure that will be executing on a recurring basis at different intervals. There is a field that I need to populate with 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: Are the posted questions getting worse?

    BLOB_EATER (9/13/2016)


    Jeff Moden (9/13/2016)


    BLOB_EATER (9/13/2016)


    Anyone willing to share general stats on their blogs. ( Or is this a rude request??!)

    I have received 1000 views within the past 6 months 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: delete millions of rows

    ChrisM@Work (9/13/2016)


    Cache priming can make a very significant difference to batch delete times.

    Curious... isn't that just moving the problem to something else? You still have to do 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: Are the posted questions getting worse?

    BLOB_EATER (9/13/2016)


    Anyone willing to share general stats on their blogs. ( Or is this a rude request??!)

    I have received 1000 views within the past 6 months which is poor (...

    --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: delete millions of rows

    The Dixie Flatline (9/13/2016)


    Jeff, I've got someone trying to get that information now. But by my calculations, it's doing 444 rows per second. That seems slow.

    Curiously,...

    --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 - 16,831 through 16,845 (of 59,067 total)