O'Reilly logo

Microsoft® SQL Server 2012 Unleashed by Alex T. Silverstein, Chris Gallelli, Paul T. Bertucci, Ray Rankins

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating Backup Devices

You can create logical backup devices by using T-SQL or SSMS. The T-SQL command for creating these logical backup devices is sp_addumpdevice, which has the following syntax:

sp_addumpdevice [ @devtype = ] 'device_type'        , [ @logicalname = ] 'logical_name'        , [ @physicalname = ] 'physical_name'      [ , { [ @cntrltype = ] controller_type |          [ @devstatus = ] 'device_status' }      ]

The following sample script demonstrates the creation of the different types of backup devices:

-- Local DiskEXEC sp_addumpdevice 'disk', 'diskdev1',    'c:\mssql\backup\AdventureWorks2012.bak'-- Network DiskEXEC sp_addumpdevice 'disk', 'networkdev1',    '\\myserver\myshare\AdventureWorks2012.bak' ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required