June 24, 2015 at 4:55 am
Hi all,
Bit of a weird one...
I've got an automated script which restores a database to a SQL server 2008 R2 instance.
Works as expected.
However, looking at the last run and the db has restored - which I wasn't expecting. Looking into the source directory and the .bak file isn't visable. I've checked the permissions on the directory and see no reason why I shouldn't be able to list the files within.
Also checked the parent folder for size on disk and it's zero.
Checked in SSMS and sure enough, the .bak file is visible when navigating to the directory in the restore db GUI.
What's going on?!
Rich
June 24, 2015 at 5:02 am
Found the issue!!
User error 🙁
My automated script was calling SQLCmd which connects to a remote machine to perform the restore - the path it was restoring was not the one I had expected.
Should have been more explicit in my restore command! 😉
June 24, 2015 at 8:42 am
I have to ask... why are you using SQLCMD for this task? A simple stored procedure is able to do these types of restores no problem (I have a scheduled proc that does it every night for me).
--Jeff Moden
Change is inevitable... Change for the better is not.
June 24, 2015 at 9:32 am
Hi Jeff -
The call is coming from an external application. I guess we could have created a proc and called that instead!
June 24, 2015 at 9:47 am
Ok and agreed. Thanks for the feedback. I appreciate it.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply