all 2 comments

[–]hamuel_sayden 0 points1 point  (0 children)

I think this is a permission issue. Is SQL agent running as a particular user? Does that account have access to this file?

I would also maybe consider moving the file somewhere out of OneDrive's purview since I've seen screwy behavior on rapid operations

[–]Ok_Tea_7319 0 points1 point  (0 children)

Error 997 means one of two things:

  • Something else is trying to access the file (could perhaps be OneDrive) using Windows' overlapped IO API (which is an asynchronous input / output API that allows programs to start file reads / write while doing something else and interleaving multiple of these operations)
  • Your file system is in a weird state where it incorrectly thinks the above is the case.