How many characters in total

  • Thread starter Thread starter Patrick
  • Start date Start date
P

Patrick

HI!!
I was wondering what's the maximum caracters
that 'Sqlstring' could take in the following usage.
dim Sqlstring as string

Ex.: Sqlstring = "Select * from Table1"

dbs.execute sqlstring

Is their a maximum that,once obtained, will not be
executed by the 'dbs.Execute'...

My problem is that I gather info from different tables.
Right now I've got 10 but they represent a fiscal year. So
every year the number of table will increase by +1.
Inside my 'sqlstring' is the accumulation of 10 'select *
from... fallowed by a UNION'. Then its sent to a report.

So I can imagine when I hit number of tables = 20.
My 'Sqlstring' will be very long. Will this be a problem
for the 'dbs.execute'. Is there a maximum....

I'm sure this is not the most effective way to cycle thru
an unknown number of tables( to gather info).. I'm
defenitly open to suggestions....

Thanks in advance for any help you can provide-me with!
PAtrick
 
According to the help file (search for 'specifications') the maximum number
of characters in a SQL statement is approximately 64,000. The help file also
mentions a limit of 32 tables in a query, but I think it means joins - I did
a quick test, and this limitation doesn't seem to apply to tables in a union
query, I was able to successfully run a union query that included 34 tables.

So, it looks as if you might actually be able to get away with this for
quite some time. Which doesn't mean that you *should* of course - creating
separate tables for each year flies in the face of the most basic principles
of relational database design.
 
Thanks for your input, much appreciated.
-----Original Message-----
According to the help file (search for 'specifications') the maximum number
of characters in a SQL statement is approximately 64,000. The help file also
mentions a limit of 32 tables in a query, but I think it means joins - I did
a quick test, and this limitation doesn't seem to apply to tables in a union
query, I was able to successfully run a union query that included 34 tables.

So, it looks as if you might actually be able to get away with this for
quite some time. Which doesn't mean that you *should* of course - creating
separate tables for each year flies in the face of the most basic principles
of relational database design.

--
Brendan Reynolds (MVP)




.
 
Back
Top