Results 1 to 10 of 10
  1. #1
    Join Date
    Dec 2003
    Posts
    18

    Unanswered: Truncate table in Excute SQL Task?

    Hello,

    I am in DTS package design page, I tried to
    1) Truncate table using Excute SQL Task
    2) Import txt file from the server folder (txt file souce) to SQL 2000 table by using Transform data task.

    Can I truncate table using Excute SQL task?
    How can I let DTS package to know to trancate the table first before import txt file?

    Thank you for your help in advance.
    Yanoroo

  2. #2
    Join Date
    Feb 2002
    Posts
    2,232
    Yes - Just create the task and use a flow to connect to the next task.

  3. #3
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    You can do both tasks in one T-SQL step:

    truncate...
    bulk insert...

  4. #4
    Join Date
    Sep 2003
    Posts
    212
    yes as long as u have the sql for both ur truncate and bulk insert.

  5. #5
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    No, really?

  6. #6
    Join Date
    Feb 2002
    Posts
    2,232
    It just depends on what level of control you want - If you want to do a on failure of truncate and b on success of truncate then you can create a truncate step followed by a load step if successful or an email step if failure ...

  7. #7
    Join Date
    Dec 2003
    Posts
    18
    Originally posted by rnealejr
    Yes - Just create the task and use a flow to connect to the next task.

    Please bear with me, what is the difference between
    1) on completion and 2) on success?

    It sounds very similar....

    Thanks,
    Yanoroo

  8. #8
    Join Date
    Sep 2003
    Posts
    212
    Originally posted by rnealejr
    It just depends on what level of control you want - If you want to do a on failure of truncate and b on success of truncate then you can create a truncate step followed by a load step if successful or an email step if failure ...
    well in the sql task u can have truncate table command and also an insert command as long as u have the sql for the insert command it'll do in the execute sql task. but yeah otherwise what rnealejr is arite

  9. #9
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    On Completion = regardless of the outcome (succeeded or failed)

  10. #10
    Join Date
    Dec 2003
    Posts
    18
    Thank you guys!

    I'll give it try. Yanaroo

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •