Hi
Is there any way I can run a back up routine from a batch file
regards
Jonathan
===============
Jonathan Crawford
01273 440018
07799 068570
fax 01273 380221
jc@.jcrawford.co.uk
===============You mean you want to perform for instance a database backup from a .BAT file
? If so, yes:
Create the bat file. In there, you call OSQL.EXE using the /Q parameter, whe
re after the /Q
parameter you have your BACKUP command. Here's a simple example with a PRINT
instead of BACKUP
command:
OSQL /E /Q "Print 'Hello'
The command line switches for OSQL as well as the BACKUP command are documen
ted in Books Online.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Jonathan Crawford" <jc@.jcrawford.co.uk> wrote in message
news:u3nc$KoEFHA.3992@.tk2msftngp13.phx.gbl...
> Hi
> Is there any way I can run a back up routine from a batch file
> regards
> Jonathan
> --
> ===============
> Jonathan Crawford
> 01273 440018
> 07799 068570
> fax 01273 380221
> jc@.jcrawford.co.uk
> ===============
>|||You can call the SQL Server command line utility (called osql.exe) from a
batch file, and you can run all SQL statements in osql, including BACKUP.
You can find the complete syntax for osql in Books Online.
Jacco Schalkwijk
SQL Server MVP
"Jonathan Crawford" <jc@.jcrawford.co.uk> wrote in message
news:u3nc$KoEFHA.3992@.tk2msftngp13.phx.gbl...
> Hi
> Is there any way I can run a back up routine from a batch file
> regards
> Jonathan
> --
> ===============
> Jonathan Crawford
> 01273 440018
> 07799 068570
> fax 01273 380221
> jc@.jcrawford.co.uk
> ===============
>|||You can invoke the osql commad from the batch file. Which in turn does the
actual backup using an SP / backup command.
HTH,
Vinod Kumar
MCSE, DBA, MCAD, MCSD
http://www.extremeexperts.com
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp
"Jonathan Crawford" <jc@.jcrawford.co.uk> wrote in message
news:u3nc$KoEFHA.3992@.tk2msftngp13.phx.gbl...
> Hi
> Is there any way I can run a back up routine from a batch file
> regards
> Jonathan
> --
> ===============
> Jonathan Crawford
> 01273 440018
> 07799 068570
> fax 01273 380221
> jc@.jcrawford.co.uk
> ===============
>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment