Results 1 to 5 of 5

Thread: DB2 Error when running DTS package

  1. #1
    Join Date
    Nov 2006
    Posts
    42

    DB2 Error when running DTS package

    Hello:

    I am using SQL Server 2000, SP4. I have a DTS package that creates some .txt files and then tries to upload them to a DB2 server using a .cmd script. The .cmd script calls a .sql file that has the username, password and upload details.

    When I run the .cmd script on its own, by double-clicking it in Windows Explorer, it runs successfully. When I try to execute it from within my DTS package, I get the following error:

    "DB21005E An error occurred while accessing the file...."

    I've Googled the error message and all I could find was that it may be a permissions issue of some kind. The SQL account I am using to run the DTS package has DBO permissions. It is the same account I use to run all my DTS packages and this is the only one failing.

    The error appears to be occurring when trying to open the .sql file as opposed to trying to run the commands in it. I don't think it's getting that far.

    Any ideas? I'm stumped!

  2. #2
    Join Date
    Sep 2002
    Posts
    5,938
    Where is the .cmd file? Does sql service account have permission to access it?

  3. #3
    Join Date
    Nov 2006
    Posts
    42
    I think the problem was that the .cmd file did not include a command to switch to the directory that the .sql file was in before trying to execute it. That wasn't a problem when I was executing the .cmd file directly, but was a problem when calling it from the DTS package.

  4. #4
    Join Date
    Sep 2002
    Posts
    5,938
    You can call sql file with full path.

  5. #5
    Join Date
    Nov 2006
    Posts
    42
    That's what I did and that piece seems to be working now. We're getting other errors but they seem unrelated. If necessary I'll start a new thread; meanwhile we're troubleshooting at this end.

    Thanks for your replies.

Posting Permissions

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