DTS Execute SQL Task Properties Issue

  • I am trying to execute 3 SQL Statements in an Execute SQL Task Properties Step. The 3 Statements are:

    Truncate Table MyTable

    Go

    --Added to eliminate duplicate records on 10/26/04 by KG.

    Truncate Table TableA

    Go

    INSERT INTO TableA

    SELECT * FROM TableB

    Go

    When I run the Step within the DTS Designer it appears to work fine. But, when I run the Job, the Step does not appear to execute (I still see the old data in the Tables which are supposed to have been Truncated.) Do I need the GO Statements? Is the --Comment Line causing a problem?

    Thanks in advance, Kevin

     

  • It may be a permissions problem.  Scheduled packages run under the security context of the login that starts SQL Server Agent. Check the permissions of that login.  It has to be a member of sysadmin, db_owner, or db_ddladmin to use TRUNCATE TABLE. 

    Greg

    Greg

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply