Backup Path on Stored Procedure

  • I am trying to move away from using the maintenance plan wizard and thought I would try and create a SP with the help of Tara Kizer's isp_backup SP found here....

    Here

    Now what I have found is that if I enter in the @path variable my desired path of

    'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\ISP_Backup_Test'

    I get this...

    Cannot open backup device 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\AdventureWorks\AdventureWorks_20110525110426.BAK'. Operating system error 3(The system cannot find the path specified.).

    However, as long as I leave out Program Files and Microsoft SQL Server out of the path it works fine. Any ideas why?

  • Well I was able to get it to work by specifying a NON-8dot3 path.

    c:\Progra~1\Mi6841~1\MSSQL.1\MSSQL\Backup

    which eliminates spaces in the path name. Any ideas why this worked?

  • Put double quotes around the path in the command.

  • EXEC isp_Backup @path = "c:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup", @dbType = '-AdventureWorks', @bkpType = 'Full', @retention = 5, @liteSpeed = 'N'

    Needed double quotes...

  • lol thanks Ninja... I figured it out the same time you were posting!

  • Vertigo44 (5/25/2011)


    lol thanks Ninja... I figured it out the same time you were posting!

    Yes if by same time you mean 3 minutes later :w00t: (joke in case it's not obvious)!

Viewing 6 posts - 1 through 5 (of 5 total)

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