?
Solved

MSSQL Backup

Posted on 2010-11-09
7
Medium Priority
?
502 Views
Last Modified: 2012-05-10
I have created a batch file to do a backup of our server data using the xcopy command and that worked properly. I want to backup my MSSQL database using the same batch file, what sequence of commands do I need to backup my MSSQL Database called "test"?

My OS is SBS 2003. please ote that i dont want to use NTbackup...
0
Comment
Question by:Abbas Haidar
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 10

Expert Comment

by:Humpdy
ID: 34091740
Is it SQL Express ?
0
 
LVL 10

Expert Comment

by:Humpdy
ID: 34091750
0
 
LVL 1

Expert Comment

by:FirstMM
ID: 34091754
Hi, if I am speaking out of turn then I apologise.
I am not sure if you will be able to restore backups made by xcopy.
Are you copying the SQL server automated backup files (made by SQL server) or backing up the .mdf/.ldf files in the DATA folder?
0
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 
LVL 10

Expert Comment

by:Humpdy
ID: 34091762
I think the poster wants to be able to do a SQL backup from within a batch file which he is using already.

adding this into it should do the trick.

cd (locaction where oSQL exe is)
oSQL -E -S server\datbase
backup database database_name to disk='d:\location\db.bak'
go
0
 
LVL 10

Accepted Solution

by:
Humpdy earned 500 total points
ID: 34091775
BTW, you don't want to do a copy of the mdf and ldf file. You probably won't be able to restore that correctly. You have do a SQL backup, like oSQL.
you could also kick off an SSIS package but that's more complex.
0
 
LVL 7

Author Comment

by:Abbas Haidar
ID: 34091778
you are right Humpdy, I want to backup the MSSQL 2005 Databse to my external hard drive using a batch file, I will try your solution and see :D.

thanks
0
 
LVL 3

Expert Comment

by:DDB
ID: 34103625
I have 3 Store Procedures that creates database backups (FULL, DIFF, LOGs). I scheuled 3 separate jobs with SQL Server agent to run backups. I also have another batch command (.bat) file that copies my backup to external drive ising Windows scheduler. I notice that COPY or Xcopy sometimes does not work so I used ROBOCOPY.  
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Suggested Courses

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question