Sponsored Links

Login Form






Lost Password?

Syndicate

Home
Backup VMware SQL 2005 Express Databases PDF Print E-mail
User Rating: / 1
PoorBest 
Written by Cheyenne Harden   

I just upgraded our systems with VMware's ESX server.
When installing you can use SQL 2005 Express, but the downfall is that there isn't an automated backup in the management studio.
So I created a batch file that would call a SQL query.

 

 

 

 

This is the first SQL Query "Save as sqlbackup1.sql"
----------COPY EVERYTHING BELOW THIS LINE----------
BACKUP DATABASE [VIM_UMDB] TO  DISK = N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\VIM_UMDB.bak' WITH NOFORMAT, NOINIT,  NAME = N'VIM_UMDB-Full Database Backup', SKIP, NOREWIND, NOUNLOAD,  STATS = 10
GO
----------COPY EVERYTHING ABOVE THIS LINE----------

 

This is the second SQL Query "Save as sqlbackup2.sql"
----------COPY EVERYTHING BELOW THIS LINE----------
BACKUP DATABASE [VIM_VCDB] TO  DISK = N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\VIM_VCDB.bak' WITH NOFORMAT, NOINIT,  NAME = N'VIM_VCDB-Full Database Backup', SKIP, NOREWIND, NOUNLOAD,  STATS = 10
GO
----------COPY EVERYTHING ABOVE THIS LINE----------

 

This is the batch file you can schedule to run.
----------COPY EVERYTHING BELOW THIS LINE----------
sqlcmd -S.\SQLEXP_VIM -i"C:\Scripts\sqlbackup1.sql"
sqlcmd -S.\SQLEXP_VIM -i"C:\Scripts\sqlbackup2.sql"
 
----------COPY EVERYTHING ABOVE THIS LINE----------
 


***MAKE SURE NO WORD WRAP IS HAPPENING IN YOUR SCRIPT

 

1. The SQL query will backup the databases to "C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\"          
2. Place the .sql file into a directory called "C:\Scripts\"

This information is provided "AS IS" with no warranties expressed or implied.

 

Comments
Add New
Daniel Morrison  - Nice     |116.66.228.102 |22-10-2008 18:54:00
Exactly what I was looking for, thanks!
Write comment
Name:
Email:
 
Title:
 
:angry::0:confused::cheer:B):evil::silly::dry::lol::kiss::D:pinch:
:(:shock::X:side::):P:unsure::woohoo::huh::whistle:;):s
:!::?::idea::arrow:
 
Please input the anti-spam code that you can read in the image.

3.26 Copyright (C) 2008 Compojoom.com / Copyright (C) 2007 Alain Georgette / Copyright (C) 2006 Frantisek Hliva. All rights reserved."

 
Tag it:
Delicious
Furl it!
Spurl
digg
YahooMyWeb
< Prev   Next >
 

Google Search

Google