From: kc-mass on
Try this: Set it off and wait two or three minutes depending on your
machine.

Sub MakeBig()
Dim strSQL1 As String
Dim strSQL2 As String
Dim lngCount As Long
On Error GoTo E_Handle
strSQL1 = "INSERT INTO tblBig2 ( [key] ) SELECT tblBig1.key FROM tblBig1;"
strSQL2 = "INSERT INTO tblBig1 ( [key] ) SELECT tblBig2.key FROM tblBig2;"
DoCmd.SetWarnings False
Do While lngCount < 1000
DoCmd.RunSQL strSQL1
DoCmd.RunSQL strSQL2
lngCount = lngCount + 1
Loop
DoCmd.SetWarnings True
sExit:
On Error Resume Next
DoCmd.SetWarnings True
Exit Sub
E_Handle:

MsgBox Err.Description, vbOKOnly, Err.Number
Resume sExit
End Sub




"pemt" <pemt(a)discussions.microsoft.com> wrote in message
news:C8BB251F-1845-4148-8E4A-DFC344AC971A(a)microsoft.com...
> how to make a table with 10 million rows in one column?
>
> Num
> 1
> 2
> 3
> .
> .
> .
> 10,000,000
>
> thanks,
>
> pemt


From: pemt on
John,

Thanks for your help.
When I run the query you wrote, it asked me to give input of N1, N2 and N3.
I gave N1=1, N2=2, N3=3, then it said "could not find output table 'bigtable'.
how to solve it?

pemt

"John W. Vinson" wrote:

> On Mon, 22 Mar 2010 09:44:01 -0700, pemt <pemt(a)discussions.microsoft.com>
> wrote:
>
> >how to make a table with 10 million rows in one column?
> >
> >Num
> >1
> >2
> >3
> >.
> >.
> >.
> >10,000,000
> >
> >thanks,
> >
> >pemt
>
> Start with a table NUM with 1000 rows, with one field N, values 0 through 999.
> You can use Excel... Insert... Fill Series to create it quickly, and copy and
> paste into a table. Then create a Cartesian join query
>
> INSERT INTO bigtable(Num)
> SELECT 1 + N1 + 1000 * N2 + 1000000 * N3
> FROM Num AS N1, Num AS N2, Num AS N3
> WHERE N3 < 10;
>
> Lots of other ways to do it but this should be quick and easy.
>
> Compact the database when you're done...
> --
>
> John W. Vinson [MVP]
> .
>
From: John W. Vinson on
On Mon, 22 Mar 2010 12:59:01 -0700, pemt <pemt(a)discussions.microsoft.com>
wrote:

>John,
>
>Thanks for your help.
>When I run the query you wrote, it asked me to give input of N1, N2 and N3.
>I gave N1=1, N2=2, N3=3, then it said "could not find output table 'bigtable'.
>how to solve it?

Create your big 10,000,000 row table, empty; I called it "bigtable" in my
code, you should use whatever name you have chosen for your table.

And I did have a typo: the query should be

INSERT INTO bigtable(Num)
SELECT 1 + N1.N + 1000 * N2.N + 1000000 * N3.N
FROM Num AS N1, Num AS N2, Num AS N3
WHERE N3.N < 10;

--

John W. Vinson [MVP]
From: pemt on
John,

Thanks.
How to run below code in Access to make table?
n=1
n=n+1
n<10000000
print n /
end

pemt

"John W. Vinson" wrote:

> On Mon, 22 Mar 2010 12:59:01 -0700, pemt <pemt(a)discussions.microsoft.com>
> wrote:
>
> >John,
> >
> >Thanks for your help.
> >When I run the query you wrote, it asked me to give input of N1, N2 and N3.
> >I gave N1=1, N2=2, N3=3, then it said "could not find output table 'bigtable'.
> >how to solve it?
>
> Create your big 10,000,000 row table, empty; I called it "bigtable" in my
> code, you should use whatever name you have chosen for your table.
>
> And I did have a typo: the query should be
>
> INSERT INTO bigtable(Num)
> SELECT 1 + N1.N + 1000 * N2.N + 1000000 * N3.N
> FROM Num AS N1, Num AS N2, Num AS N3
> WHERE N3.N < 10;
>
> --
>
> John W. Vinson [MVP]
> .
>
From: pemt on
Hi Karl,

actually I have more than 10 M records to fill with and each one is unique.

pemt

"KARL DEWEY" wrote:

> WHY!
> --
> Build a little, test a little.
>
>
> "pemt" wrote:
>
> > how to make a table with 10 million rows in one column?
> >
> > Num
> > 1
> > 2
> > 3
> > .
> > .
> > .
> > 10,000,000
> >
> > thanks,
> >
> > pemt
First  |  Prev  |  Next  |  Last
Pages: 1 2 3 4 5
Prev: Additional Information
Next: Pie chart in columnar report