1.

Solve : Sql server database backup using batch files?

Answer»
hi FRIENDS,

I am begginer of using BATCH files . I dont know about batch files. My requirement is taking sql server database backup using Dos batch files.
You can use NET STOP to stop the SQL agent and service then once stopped you can copy your MDF and LDF database files to backup etc using a simple COPY or XCOPY command DEPENDING on what you want to do.

Look in your windows services to GET exact serice name... you should see usually both the sql service and agent running, the sql service is usually MSSQL$instancename and the agent is usually SQLServerAgent

To start the database after the backup simply NET START servicename such as NET START SQLServerAgent

Hope this helps.


Discussion

No Comment Found