SQL 2008 Express R2 automatic backup

Hi all,

I have SQL Server 2008 Express with Management Studio installed on my machine running a Microsoft BCM database.

I'd like to do automatic backups every day to a local drive.

From searching around in EE, it appears i need to have SQL Server Agent running to do this. When i try to enable this service, i get the following error:

0
When i try to start this service in Task Manager, i get "The operation could not be completed. Access is denied."

What am i doing wrong? Thanks in advance.
Go-BruinsAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Nakul VachhrajaniTechnical Architect, Capgemini IndiaCommented:
SQL Server Express does not support SQL Server Agent. If you want to use the agent, you need to upgrade to a "paid" edition of SQL Server according to the MS Connect item here:
https://connect.microsoft.com/SQLServer/feedback/details/427885/sql-server-agent-for-express-editions

It is also documented in the Supported Features documentation for SQL Server 2008 R2: https://msdn.microsoft.com/en-us/library/cc645993(v=sql.105).aspx
Go-BruinsAuthor Commented:
Darnit - too bad.

Is there another (simple) way to automatically backup an Express database?
Boyd (HiTechCoach) Trimmell, Microsoft Access MVPDesigner and DeveloperCommented:
I use SQLCMD.EXE to run a .SQL script

Here is how I do it:

I schedule this cmd file:

sqlbackup.cmd
Echo |date /T>>c:\scripts\sqlbackup_log.txt

Echo |time /T>>c:\scripts\sqlbackup_log.txt

"C:\Program Files\Microsoft SQL Server\100\Tools\Binn\SQLCMD.EXE"  -S servername\database -i C:\scripts\sqlbackup.sql >> c:\scripts\sqlbackup_log.txt

Open in new window


sqlbackup.sql
DECLARE @name VARCHAR(50) -- database name
DECLARE @path VARCHAR(256) -- path for backup files
DECLARE @fileName VARCHAR(256) -- filename for backup
DECLARE @fileDate VARCHAR(20) -- used for file name
SET @path = '\\computer\shared\Backups\' --path to the backup folder
SELECT @fileDate = CONVERT(VARCHAR(20),GETDATE(),112)
DECLARE db_cursor CURSOR FOR
SELECT name
FROM master.dbo.sysdatabases
WHERE name NOT IN ('tempdb')
OPEN db_cursor
FETCH NEXT FROM db_cursor INTO @name
WHILE @@FETCH_STATUS = 0
BEGIN
SET @fileName = @path + @name + '_' + @fileDate + '.BAK'
BACKUP DATABASE @name TO DISK = @fileName
FETCH NEXT FROM db_cursor INTO @name
END
CLOSE db_cursor
DEALLOCATE db_cursor

Open in new window



also see:

http://support.microsoft.com/kb/2019698

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Go-BruinsAuthor Commented:
Thank you. I'll try this and report back.
Go-BruinsAuthor Commented:
Thank you, one and all.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server 2008

From novice to tech pro — start learning today.