Truncate In Access

  • Thread starter dz2k7 via AccessMonster.com
  • Start date
D

dz2k7 via AccessMonster.com

Is there any way in Access to drop the table and free up the space at the
same time like TRUNCATE does.

DELETE * FROM my_table; dosen't free up space.

DROP TABLE my_table; doesn't do that too.

The problem is that my tables are big and I hit 2GB limit all the time.
I don't want to compact and repare DB everytime I delete a table because I
can't automate this from inside the DB. I don't want to manage this DB from
outside writing VBS scripts or something.

Any ideas?
 
K

Klatuu

It is unusual to hit the 2G limit. Is there any chance you have any
graphical images or pictures embedded in the database? That is usually the
cause of a mdb hitting the 2G limit.

If this is the case, a better solution is to store all the images in a
folder and use either a text or hyperlink field in a table to point to the
external graphics.

But, if this is not the case and you actually have that much data, it is
time to consider upsizing to SQL Server.
 
J

John W. Vinson

Is there any way in Access to drop the table and free up the space at the
same time like TRUNCATE does.

DELETE * FROM my_table; dosen't free up space.

DROP TABLE my_table; doesn't do that too.

The problem is that my tables are big and I hit 2GB limit all the time.
I don't want to compact and repare DB everytime I delete a table because I
can't automate this from inside the DB. I don't want to manage this DB from
outside writing VBS scripts or something.

Any ideas?

In addition to Karl's and Klatuu's concerns... why are you routinely creating
(or filling) and dropping (or emptying) tables AT ALL? "Scratch" tables are
only rarely necessary. If this is one of the rare cases where you do have a
demonstrable need for a scratch table (i.e. a Select query is too slow or
cannot be run for some other reason), then consider creating and deleting a
"scratch" .mdb file. See

http://www.granite.ab.ca/access/temptables.htm

for an example.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top