question

chitrarekhasaha avatar image
chitrarekhasaha asked

How to automate backup of sqlexpress

We have installed sqlserver management studio 2017 on sqlexpress 2014 and I would like to create the backup job and schedule the task. Following the link below https://www.lumension.com/kb/Home/General-Information/Performing-database-backups-for-SQL-Express-using.aspx The job runs but does not create backups: ![alt text][1] [1]: /storage/temp/4199-sqlexpress-backup-job.png and the argument reads as : -S [SERVER] -E -i D:\Scripts\schedule.sql and I am running the job as sqluser
sqlserver2012
2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

ThomasRushton avatar image ThomasRushton ♦♦ commented ·
What error messages are you seeing both in the scheduler log and in the SQL Server log? What's the contents of your "schedule.sql" script?
0 Likes 0 ·
chitrarekhasaha avatar image chitrarekhasaha commented ·
Script of schedule.sql: DECLARE @pathName NVARCHAR(512) SET @pathName = 'D:\SQL Backup\db_backup_' + Convert(varchar(8), GETDATE(), 112) + '.bak' BACKUP DATABASE [bcmdb] TO DISK = @pathName WITH NOFORMAT, NOINIT, NAME = N'db_backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10 The user running the job is a dbowner but is not sysadmin. In sqlexpress this user do not have access to sqlserver logs. In Program/Scripts browsed to "C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn\SQLCMD.EXE" and the argument S [BMC\SQLExpress] -U bcmdbuser -P Bcmuser@06 -i D:\Scripts\schedule.sql
0 Likes 0 ·

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.