After migrating to Windows 11 - Cannot bulk load because the file could not be opened. Operating system error code 5 (Aaccess is denied)

DoveConnieDES-3786 1 Reputation point
2024-07-08T18:52:02.8866667+00:00

I just moved to a Windows 11 PC and now when using SSMS and I try to do a Bulk Insert into a SQL 2017 database, I get this error. Cannot bulk load because the file could not be opened. Operating system error code 5 (Aaccess is denied)

I can do the same bulk insert on my Windows 10 machine without any issues.

I have verified permissions. I am logging into SSMS as a sysadmin.

Has anyone else ran into this issue?

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,319 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
8,929 questions
{count} votes

4 answers

Sort by: Most helpful
  1. Erland Sommarskog 106.5K Reputation points
    2024-07-08T22:06:47.0766667+00:00

    So this is a double-hop issue. That is, you authenticate to SQL Server, and then SQL Server impersonates you when running BULK INSERT. But SQL Server must somehow pass your security token to the machine with the file share.

    A base requirement is that the query:

    SELECT auth_scheme FROM sys.dm_exec_connections WHERE session_id = @@spid
    

    must return KERBEROS. If it returns NTLM, it can never work. If you have KERBEROS, there are still SPNs and that, which I am not very good at, which must be in place.

    I seem to recall that more people have reported that they have had these sort of problems with Windows 11 clients, so maybe things need to be set up differently when Windows 11 is in the mix.

    0 comments No comments

  2. Bruce (SqlWork.com) 61,186 Reputation points
    2024-07-08T22:53:32.45+00:00

    as suggested, most likely kerberos is not being used. there are two common causes:- windows 11 not defaulting to kerberos on autologin. google for registry settings- windows defender blocking kerberos to the desired SPN

    0 comments No comments

  3. LucyChenMSFT-4874 2,985 Reputation points
    2024-07-09T02:02:22.5866667+00:00

    Hi @DoveConnieDES-3786,

    Thank you for reaching out and welcome to Microsoft Q&A!

    In addition to Erland's answer, please refer to this article, it shows the cause of this issue and how to resolve it.

    Here is an issue like yours, you can check it out to understand more! Hope this can help you well.

    Feel free to share your issue here if you have any concerns.

    Best regards,

    Lucy Chen


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our Documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    https://docs.microsoft.com/en-us/answers/support/email-notifications


  4. DoveConnieDES-3786 1 Reputation point
    2024-07-11T13:24:52.0266667+00:00

    So far the issue has not been resolved. We have looked at the various info posted and everything is set properly. We did more testing yesterday and it is starting to point to a possible VPN issue. I will know more after Friday when additional testing can be done.

    Thank you everyone that has offered assistance.

    0 comments No comments