SSMS does not see my NAS

  • I am running Server 2014 and SSMS does not see my SYNOLOGY NAS drive. File Explorer sees it and I can access any file thru it. How do I configure SSMS to see it?

  • is your server clustered?

    In that case, SQL can only see shared clustered drives.

    if it's a plain old vanilla server, are you using a mapped drive? could the drive mapping be unique to just your login?

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • I don't know if its clustered. I downloaded the Northwind database to a folder on the NAS called Databases. File Explorer sees it as my mapped Z drive, but when I go to Attach it in SSMS it lists my C & D drives but not my mapped Z drive. Z is the NAS drive.

  • since it's not physically attached, you have to jump through some hoops.

    if you search for "map network drive for all users" you'll see the issue: shared drives ar eper user, and SQL is probably running under either system or a specific account.

    if this is just for a short term thing, you can do it via xp_cmdshell;

    exec master.dbo.xp_cmshell 'NET USE G: \\UNCPath\d$ /user:domain\user password'

    GO

    Restore Database DBName FROM Disk = 'G:\Path to bak'

    GO

    EXEC master.dbo.xp_cmdshell 'NET USE G: /DELETE'

    NET USE path password /USER:domainname\username password

    --working example

    exec master.dbo.xp_cmdshell 'NET USE J: \\DEV223\c$\DataFiles /user:disney\lizaguirre MySecretPassword /persistent:yes'

    if you want it to be permanent, it's a bit tougher.

    if you are running as a domain user, there's some links saying add a login script under all users;

    if you are running under system, you can use psexec to run a s the system account, according to this stack overflow, then it should be available?

    http://serverfault.com/questions/426288/permanently-mount-network-share-without-the-need-for-log-on-windows

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • I tried the psexec and it said it mapped to my Z drive successfully, but SSMS still doesn't see it. I am going to reboot to see if that makes any difference. Thanks for your help.

  • Have you tried using powershell to map the drive ?

    here is the general syntax, this will Map drive with name "S" to the path \\server1\share

    New-PSDrive –Name “S” –PSProvider FileSystem –Root “\\server1\share” –Persist

    For restoring database, if it is a repetitive thing I would create powershell script to map the drive and do the restore then schedule the script to run from sql job.

  • Reboot did not make a difference.

  • The response to that is "The local device name is already in use".

    Should I Delete it using psexec? And then try it again? Shouldn't make a difference. Correct?

  • you can remove the mapped drive using Remove-PSDrive, example below removes mapped drive "S"

    Remove-PSDrive -name S

  • I wouldn't remove it. It's saying the drive is already mapped. The question is, why it would appear otherwise.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • I tried the PowerShell command with no quotes an quotes around FileSystem and got this:

    PS C:\WINDOWS\system32> New-PSDrive –Name “S” –PSProvider "FileSystem" –Root “\\isicsflws02\isicsflws02” –Persist

    New-PSDrive : The network resource type is not correct

    At line:1 char:1

    + New-PSDrive –Name “S” –PSProvider "FileSystem" –Root “\\isicsflws02\i ...

    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo : InvalidOperation: (S:PSDriveInfo) [New-PSDrive], Win32Exception

    + FullyQualifiedErrorId : CouldNotMapNetworkDrive,Microsoft.PowerShell.Commands.NewPSDriveCommand

  • I think this question needs clarification. SSMS can "see" your Z: drive, can't it? Use File | Open file and check if you can't browse your Z: drive. You should be able to do this.

    I think what you're having trouble with is ATTACHing a database file that resides on a network drive. I've never done this but have read about it, believe this is possible. Formerly TF 1807 was used for this. Now with SQL 2014 I am not sure if this TF still works or not. I did find , which appears specific to SQL 2014 but appears to apply only at setup!

    You'd face the same problem if you tried to create a new DB with files on the Z: drive. I think this topic would get more search hits, maybe even more answers here.

  • If you have a clustered environment then you will need to add the drives as dependancies of the SQL Server resource in failover cluster manager

    _________________________________________________________________

    "The problem with internet quotes is that you cant always depend on their accuracy" -Abraham Lincoln, 1864

  • In SSMS, I tried File->Open->File and clicked on my Z drive and I get the following message:

    "An error occurred while reconnecting to Z: to \\ISICSFLSYN01\ISICSFLSYN01

    Microsoft Windows Network: A special logon session does not exist. It may already have been terminated.

    This connection has not been restored"

    In File Explorer it sees everything on Z:

  • Guess I was wrong! Sorry. Well, I think that's a good test case anyway, takes any special ATTACH considerations out of the picture.

    Weird error. Using SSMS (SQL 2012) I open files from mapped drives, subst'ed drives, \\UNC\Shares, etc. every day with no problems.

Viewing 15 posts - 1 through 14 (of 14 total)

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