dbTalk Databases Forums  

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

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss How do you add a TRUNCATE TABLE command to a dts package in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Burak Gunay
 
Posts: n/a

Default How do you add a TRUNCATE TABLE command to a dts package - 02-21-2006 , 09:19 AM






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


Reply With Quote
  #2  
Old   
prefect
 
Posts: n/a

Default Re: How do you add a TRUNCATE TABLE command to a dts package - 02-21-2006 , 09:24 AM






i didn't understand a word about what you are doing,
but you could use ExecuteSql task to run any query you want.

"Burak Gunay" <burak30 (AT) aol (DOT) com> wrote

Quote:
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




Reply With Quote
  #3  
Old   
Burak Gunay
 
Posts: n/a

Default Re: How do you add a TRUNCATE TABLE command to a dts package - 02-21-2006 , 09:46 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


Reply With Quote
  #4  
Old   
SQL
 
Posts: n/a

Default Re: How do you add a TRUNCATE TABLE command to a dts package - 02-21-2006 , 09:51 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/


Reply With Quote
  #5  
Old   
Burak Gunay
 
Posts: n/a

Default Re: How do you add a TRUNCATE TABLE command to a dts package - 02-22-2006 , 08:43 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


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.