Discussion:
how to truncate a table in Access
(too old to reply)
Rockitman
2008-11-20 23:28:01 UTC
Permalink
I'm creating a local package in a 2000 SQL server that FTP's a flat file,
transforms this data to a table in an Access database, then transforms this
table to a table on the SQL server. We use the Access database for other
things, so don't ask why I'm not just moving the data straight to the SQL
table.
My problem is that unless I put out a clean Access file in the desired
directory (by clean, I mean that the table in it is blank) before this
package runs, it will error out because it will see duplicate entries in the
table.

So, how can I clear the contents of this Access table first, using this
local package?
Which task will do this? Is it possible?
Gerald Aichholzer
2008-11-21 11:44:54 UTC
Permalink
Hi,
Post by Rockitman
I'm creating a local package in a 2000 SQL server that FTP's a flat file,
transforms this data to a table in an Access database, then transforms this
table to a table on the SQL server. We use the Access database for other
things, so don't ask why I'm not just moving the data straight to the SQL
table.
My problem is that unless I put out a clean Access file in the desired
directory (by clean, I mean that the table in it is blank) before this
package runs, it will error out because it will see duplicate entries in the
table.
So, how can I clear the contents of this Access table first, using this
local package?
Which task will do this? Is it possible?
you can use SQL (the Access syntax of course):

DELETE * FROM tablename

HTH,
Gerald
Girish Nanjangud
2008-12-02 05:33:00 UTC
Permalink
hi gerald,

the delete command will only deletet rows in the MS Access and it wont
delete the blank spaces. the MS Access database will not free the memory
space occupied by table even though if you use the command DELETE * FROM
TABLE_NAM

so, my question is "is there any command like TRUNCATE TABLE_NAME in MS
Access database which will act simillar in the oracle data base"....

The TRUNCATE TABLE_NAME command in ORACLE will free the memory occupied by
the table....... i want the same functionality in MS Access...... and is it
possible in MS Access????

if any body have the answer for this please do reply to me on the e-mail id
given below
Post by Gerald Aichholzer
Hi,
Post by Rockitman
I'm creating a local package in a 2000 SQL server that FTP's a flat file,
transforms this data to a table in an Access database, then transforms this
table to a table on the SQL server. We use the Access database for other
things, so don't ask why I'm not just moving the data straight to the SQL
table.
My problem is that unless I put out a clean Access file in the desired
directory (by clean, I mean that the table in it is blank) before this
package runs, it will error out because it will see duplicate entries in the
table.
So, how can I clear the contents of this Access table first, using this
local package?
Which task will do this? Is it possible?
DELETE * FROM tablename
HTH,
Gerald
Loading...