Generate Random alphanumeric value based on timestamp

  • Siva Ramasamy

    Hall of Fame

    Points: 3781

    Hi All,

    Thank you for looking into my question.

    Does anyone have a script that could take the current timestamp and convert that into a random alphanumeric value (30+ digits).

    Thanks

  • rVadim

    Hall of Fame

    Points: 3890

    Why not simply use NEWID() function? Or you want date and time to be a part of the generated random number? I guess sample of the desired output will be nice.

    --Vadim R.

  • Jeff Moden

    SSC Guru

    Points: 994238

    Siva Ramasamy wrote:

    Hi All, Thank you for looking into my question. Does anyone have a script that could take the current timestamp and convert that into a random alphanumeric value (30+ digits). Thanks

    A 30 character random alpha-numeric generator will generate a shedload of swear words.  Us 2 GUIDs, instead.

    --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.
    "If you think its expensive to hire a professional to do the job, wait until you hire an amateur."--Red Adair
    "Change is inevitable... change for the better is not."
    When you put the right degree of spin on it, the number 3|8 is also a glyph that describes the nature of a DBAs job. 😉

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

Viewing 3 posts - 1 through 3 (of 3 total)

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