Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a table that contains null values, I need to populate this field with a random number in order for it to fit into my link table.
Can anybody recommend the best loop approach to do this, my table does contain a min and max order number that I could use to control the loop.
Rgds
Something like this maybe:
Table1:
Load
FieldA
,FieldB
,FieldC
,if(len(trim(MyField))=0, autonumber(rand()),MyField) as MyField
From ...somesource...;
Something like this maybe:
Table1:
Load
FieldA
,FieldB
,FieldC
,if(len(trim(MyField))=0, autonumber(rand()),MyField) as MyField
From ...somesource...;
Hi,
Try autonumber() or RecNo() or RowNo() Functions...
Or
http://adeilson.com.br/2010/02/23/script-para-gerar-numero-randomico-no-sql-server/
Rebeca
Thanks guys, is there anyway you can dictate the starting number in an autonumber command, for example I might not want it to start at 1.
Rgds
Darrell