Mapping a drive and backing up a SQL Server database?

We go down our SQL Server databases to NAS, and was interested on the off chance that it is conceivable to go down to a brief mapped drive, instead of the UNC way. I'm reaching a stopping point.

Utilizing New-PSDrive:

New-PSDrive - Name "Y" - PSProvider FileSystem - Root "\\NAS\Backups" - Scope Global - Persist

Test-Path "Y:\SQLDBA" <# returns True #>

<# Method 1 #>

sqlcmd - E - d ace - Q "Reinforcement DATABASE [SQLDBA] TO DISK = N'Y:\SQLDBA\SQLDBA.bak' WITH INIT" - b

<# Method 2 #>

Summon Sqlcmd - Database ace - Query "Reinforcement DATABASE [SQLDBA] TO DISK = N'Y:\SQLDBA\SQLDBA.bak' WITH INIT" - QueryTimeout 999999999 - verbose - ErrorAction Stop

Evacuate PSDrive "Y"

Utilizing net utilize:

net utilize Y: \\NAS\Backups/persistent:yes

<# Method 1 #>

sqlcmd - E - d ace - Q "Reinforcement DATABASE [SQLDBA] TO DISK = N'Y:\SQLDBA\SQLDBA.bak' WITH INIT" - b

<# Method 2 #>

Summon Sqlcmd - Database ace - Query "Reinforcement DATABASE [SQLDBA] TO DISK = N'Y:\SQLDBA\SQLDBA.bak' WITH INIT" - QueryTimeout 999999999 - verbose - ErrorAction Stop

net utilize Y:/erase

Either technique gets me a similar blunder:

Can't open reinforcement gadget 'Y:\SQLDBA\SQLDBA.bak'. Working framework mistake 3(The framework can't discover the way indicated.).

Is this conceivable?
Sign In or Register to comment.