Link to home
Start Free TrialLog in
Avatar of YZlat
YZlatFlag for United States of America

asked on

Database backup using stored proc

I want to create a stored procedure that will perform full backup of my database. I am getting the following error
Error 170: Line 4: Incorrect syntax near 'E:\Backups\mydb.bak'

Can anyone help?
CREATE PROCEDURE dbo.spBackupMyDB
AS
BACKUP DATABASE mydb
TO DISK 'E:\Backups\mydb.bak'
GO

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of chapmandew
chapmandew
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of YZlat

ASKER

Silly me! Many thanks!