Error while restoring to unc path from windows 7

  • I am using windows server 2008 R2 .When i try to restore database to UNC path from a windows 7 and windows server 2008 i get error like

    System.Data.SqlClient.SqlError: The operating system returned the error '5(Access is denied.)' while attempting 'CreateFileW' on '\\pc132\d\dbname.mdf'. (Microsoft.SqlServer.Smo)

    But if i try to restore database to UNC path from Windows XP then it restores properly.The unc path is already shared. So please help me on this error.

  • You mention Windows Server 2008 R2, Windows 7 and Windows XP.

    Where's SQL Server?

    You have a database with a data file on a UNC path? Really??

    -- Gianluca Sartori

  • Not that I have ever restored a database to a network location, I have backed up to a network location so the same principal will apply.

    When using UNC paths you must make sure that the account the SQL Server Service is running under has the neccessary permissions on the share.

    So in your case it will need to have read \ write permissions. If you are running the SQL Server Service under an account like Local System, you will need to change the service to run under a named domain account and ensure that domain account has the privilages on the share.

    Your own permissions on the share is irrelevant, the important bit is the service account has to have the permissions.

    MCITP SQL 2005, MCSA SQL 2012

Viewing 3 posts - 1 through 2 (of 2 total)

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