Setting a Derived Column to a Random Value

  • I need to set a field to be a random value. I cant see a random function in SSIS, is there any workarounds for this?

  • use TSQL to do it. there's a RAND() function.

    Syntax would be something like:

    update tablename

    set randomfield=RAND(primarykey)*20000000000 -- RAND() will return a number between 0 and 1

    cast it to integer if need be.

    ----------------------------------------------------------------------------------
    Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?

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

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