all groups > sql server dts > february 2006 >
You're in the

sql server dts

group:

How do you add a TRUNCATE TABLE command to a dts package


How do you add a TRUNCATE TABLE command to a dts package Burak Gunay
2/21/2006 7:19:23 AM
sql server dts:
Hello,

I am using DROP TABLE and CREATE TABLE commands in a dts package when
what I really need is to just use TRUNCATE TABLE command.

I manually modified the DROP TABLE to TRUNCATE TABLE and saved the
package. When I ran the package, it came back with

" Error string: Invalid SQL statement; expected 'DELETE', 'INSERT',
'PROCEDURE', 'SELECT', or 'UPDATE'. "

How do you create a TRUNCATE TABLE command to a dts package??

Thanks,

Burak
Re: How do you add a TRUNCATE TABLE command to a dts package Burak Gunay
2/21/2006 7:46:36 AM

When I run the ExecuteSqlTask "truncate table audit_crs_eqmt"

I get

" Error string: Invalid SQL statement; expected 'DELETE', 'INSERT',

'PROCEDURE', 'SELECT', or 'UPDATE'. "

But I am trying to truncate an old foxpro (version 2.6a) table and
maybe that's the cause of the problem.

Burak
Re: How do you add a TRUNCATE TABLE command to a dts package SQL
2/21/2006 7:51:20 AM
FoxPro doesn't have a truncate command it has something called ZAP

Issuing ZAP is equivalent to issuing DELETE ALL followed by PACK, but
ZAP is much faster.


http://sqlservercode.blogspot.com/
Re: How do you add a TRUNCATE TABLE command to a dts package prefect
2/21/2006 5:24:35 PM
i didn't understand a word about what you are doing,
but you could use ExecuteSql task to run any query you want.

[quoted text, click to view]

Re: How do you add a TRUNCATE TABLE command to a dts package Burak Gunay
2/22/2006 6:43:42 AM

I tried typing ZAP into the dts package but when I run it complains
thta it doesn't recognize that keyword.

The weird thing is even executing DELETE in the dts pacakage doesn't
seem to work on the old version of fox pro (2.6a) that I am using.

The only thing that works is dropping and recreating the table, which
messes up the numeric fields
ex: even though a numeric field is defined as a decimal(6,4) in the dts
package, when the table gets recreated, it gets set to (20,5) for some
reason.

If you have any ideas let me know please.

Burak
AddThis Social Bookmark Button