November 23, 2010 at 5:05 am
Hi All,
I have a table with two columns : ID and Name
Now two new columns are to be added.
so i added two more columns (say Age and Gender).
Now, i need to update the table to fill in these two columns.
there are 1 million records in the table.
Can i do something to randomly generate values for Age column (below 100) and for Gender(either 1 or 2) using Dynamic Sql or Bulk Insert?
Is there anything like that?
November 23, 2010 at 6:30 am
For ages up to 100, try
SELECT RandomAge = 1 + abs(checksum(newid()))%100
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
November 23, 2010 at 8:15 am
I think redgate has some tool to prepare the test data. you can chek the same.
Regards,
Pravasis
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply