Quantcast
Channel: SQL Server Database Engine forum
Viewing all articles
Browse latest Browse all 15264

Backup DB with stored procedure and a parameter for the destination

$
0
0
I would like to create a little backup SP that I can pass a parameter that contains the location so a user could backup to any location they wanted.  I started with this but it doesn't seem to work:
CREATE PROCEDURE [dbo].[ISRBackup]
                @Location  nvarchar(255)
AS
BACKUP DATABASE [ISR] TO  DISK = @Location WITH NOFORMAT, INIT,  NAME = N'ISR-Full Database Backup', SKIP, NOREWIND, NOUNLOAD,  STATS = 10

any suggestions?

Viewing all articles
Browse latest Browse all 15264

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>