SQL Credentials to allow bulk loading using SQL Login

  • Hi there,

    A while ago I built a Java application that incorporated a SQL trigger which read from XML files located on a server. This Java SQL db connection used a SQL login as the application it will be a part of uses this login.
    To get this working we set up a SQL credential to a domain login that has full access to this folder on the server, and linked this to the SQL user. Also both Windows and SQL logins have bulk permissions set.
    This all worked fine until a few months ago and now when testing I get the "Cannot bulk load. The file "\blah" does not exist." The only change that occurred during this time was our remote server environments were shifted across to HyperV.
    I am told this wouldn't have caused this change. I have tested within SQL using the SQL login with the same error.

    Is there anything I am missing here? I know it worked and I can't see anything that I have changed. So we have a SQL credential with permissions to this folder, linked to the SQL user.

    Any help appreciated as I have been asked to get this app up and running.

    Thanks,

    Josh

  • Isn't a SQL credential designed to give a SQL login access to folders on a server by linking it to a domain login that does have this access?
    With bulk load checked also shouldn't this let me read from a file or are there other steps I need to take? Are there other security issues at play here?

    Thanks

  • This definitely sounds like a permissions problem.  When the procedure runs, does it run as an AD login or a SQL login?  I'm referring to the type of login.  The AD login can have NTFS permission to the file system.  Another question is about the visibility of the file you're trying to import to the SQL Server - is it still available?

  • Hi Ed,

    It is using the SQL login, but this login is linked to the Windows login credential.
    I haven't had luck using the Windows login in Java, but I will try again.
    The file does exist and I can run this SQL script using my Windows login.

  • Solved. When Java copied the files across the permissions weren't inheriting the folders permission, possibly from a Windows update. I now run a batch file (using icacl) from Java to apply these permissions to the domain user and it works.

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

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