• Sqlism (9/6/2012)


    EXEC xp_cmdshell 'net use v: \\ServerName\foldername'

    Here we are assigning V as drive letter to the \\ServerName\foldername'

    -----------------------------------

    BACKUP DATABASE [XYZ] TO

    DISK = N'v\xyz.bak'

    WITH stats = 10, format

    What's the point of mapping the drive letter? SQL will back up to the UNC path quite happily provided the permissions at both ends are set up properly (and if they're not properly configured, mapping the drive isn't going to help anyway). Mapping the UNC path as a drive letter doesn't make the network more reliable or faster in any way, so it's still not the best idea unless you're dealing with relatively small databases (a few gigabytes, maybe).