dbTalk Databases Forums  

truncate statement in Execute SQL task

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


Discuss truncate statement in Execute SQL task in the microsoft.public.sqlserver.dts forum.



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

Default truncate statement in Execute SQL task - 05-18-2004 , 11:49 PM






Hi all...

Can anyone help me in trying to truncate a table using DTS. I tried
using the "truncate table" statement in an Execute SQL task but it
failed. I dont want to use "Delete table" as I want to start my seed
at 1.

Thanks in Advance.
Sivas

Reply With Quote
  #2  
Old   
William D. Bartholomew
 
Posts: n/a

Default Re: truncate statement in Execute SQL task - 05-19-2004 , 03:27 AM






Without seeing the DDL for the table all I can suggest is that you can't
use TRUNCATE TABLE on a table that is the primary key side of a
relationship, even if the foreign key side is empty.


Regards,

William D. Bartholomew
http://blog.bartholomew.id.au/

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Reply With Quote
  #3  
Old   
Nigel Rivett
 
Posts: n/a

Default Re: truncate statement in Execute SQL task - 05-19-2004 , 04:47 AM



Or maybe it's the user it's running under.

You could delete then dbcc checkident to reset the seed.


Nigel Rivett
www.nigelrivett.net

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Reply With Quote
  #4  
Old   
Sivas Sivaskanthan
 
Posts: n/a

Default Re: truncate statement in Execute SQL task - 05-19-2004 , 06:27 PM




Thank you all. Sorry about the lack of info provided and I can see that
this problem can arise from a wide varity of issues. But fortunately, in
my case, it seems to have occured due to a slight oversight on my part.

The issue was caused by me trying to run the TRUNCATE statement on an MS
ACCESS connection, instead of the SQL Server connection in my package,
like I should have. MS ACCESS does not recognise the TRUNCATE statement.
Doh!

Once again thank you all for the quick response. Much appreciated.

Sivas


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

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.