Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why doesn't Truncate work in DTS?

Status
Not open for further replies.

Seabz420

IS-IT--Management
Jul 14, 2003
129
CA
Why does TRUNCATE TABLE produce an error when I try to run it in a DTS? I'm using SQL 2000. The error is:

Invalid SQL statement; expected DELETE, INSERT, PROCEDURE, SELECT or UPDATE.

Monthly I update 1GB of data and the logs get pretty big pretty quick and need a better solution that DELETE. Ideas?
 
truncate table should work fine in DTS, providing that the person running the package has access to truncate the table.

Sounds like you've got some sort of code problem.

Denny

--Anything is possible. All it takes is a little research. (Me)
 
If you are still having the problem, you should check that you don't have any FOREIGN KEYS or indexed views over this table. Both of these scenarios will prevent you from using the TRUNCATE TABLE command.
 
What the problem was was that my Truncate SQL statement was trying to use my MS Access connection. I changed it so that it uses the SQL connection and bingo bango, it works!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top