• john_agger (6/26/2013)


    This works!

    create table #test( testtext varchar(30)

    , MyRand varchar(5) DEFAULT(REPLACE( STR( ABS( CHECKSUM( NEWID() ) ) % 10000, 5 ), ' ', '1' ) ) )

    go

    alter table #test add whentext datetime

    go

    insert into #test(testtext,whentext)

    select 'apples',getdate() union all

    select 'grapes',getdate() union all

    select 'bananas',getdate()

    go

    select * from #test

    go

    Note: four-year-old thread.

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.