generating lots of sample records

This is a discussion on generating lots of sample records within the MySQL Database forums, part of the Database Forums category; I want to generate a bunch (10000-100000) of sample records in a table with IDs from N to N+...


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-27-2007
Jason S
 
Posts: n/a
Default generating lots of sample records

I want to generate a bunch (10000-100000) of sample records in a table
with IDs from N to N+K-1. which is equivalent to:

insert into `mytable`.`myfield` (id) values (2000),(2001),(2002),
(2003),(2004);

except instead of having to write out numbers manually, I want to
generate records automatically. Here N = 2000, K=5.

what's the easiest way to do this? (preferably in sql but if there is
another easy way, I'm open to hearing it)

Reply With Quote
  #2 (permalink)  
Old 04-28-2007
strawberry
 
Posts: n/a
Default Re: generating lots of sample records

On Apr 27, 5:24 pm, Jason S <jmsa...@gmail.com> wrote:
> I want to generate a bunch (10000-100000) of sample records in a table
> with IDs from N to N+K-1. which is equivalent to:
>
> insert into `mytable`.`myfield` (id) values (2000),(2001),(2002),
> (2003),(2004);
>
> except instead of having to write out numbers manually, I want to
> generate records automatically. Here N = 2000, K=5.
>
> what's the easiest way to do this? (preferably in sql but if there is
> another easy way, I'm open to hearing it)



I don't know if it's exactly what you're after, but back in June of
last year Giuseppe Maxia describe a method for doing this sort of
thing with dates, words and numbers all purely within mysql.

http://tinyurl.com/26xf2j

HIH

Reply With Quote
  #3 (permalink)  
Old 04-28-2007
Jason S
 
Posts: n/a
Default Re: generating lots of sample records

On Apr 28, 9:22 am, strawberry <zac.ca...@gmail.com> wrote:
> I don't know if it's exactly what you're after, but back in June of
> last year Giuseppe Maxia describe a method for doing this sort of
> thing with dates, words and numbers all purely within mysql.
>
> http://tinyurl.com/26xf2j
>
> HIH


thanks, that's the kind of thing. clever!

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 04:38 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0