Recently while restoring a database with memory optimized filegroup I start facing an issue with below error message:-

Msg 3156, Level 16, State 3, Line 2 File 'XYZ' cannot be restored to 'D:\FolderPath\Memory_Optimized_FolderName'. Use WITH MOVE to identify a valid location for the file.

First I thought it might be syntax error but syntax was correct and I even checked the permission to filepath which was also fine. So what is the reason for this error?

  • What File does it refer to? N mdf/ndf/ldf or the memory optimized file (which in reality is a folder)? – Tibor Karaszi Jan 21 at 7:54
  • @TiborKaraszi Memory Optimized file. – Mr. K Jan 21 at 9:29
  • OK. I see you found the solution (I guessed that was it, but wanted to see what type of "file" is it, first.... – Tibor Karaszi Jan 21 at 13:06

I found the solution of my problem which was folder location. The folder gets created itself. So once I removed the last folder name which was in some format


And using only below path in my restoration script it starts working fine.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.