Friday, March 30, 2012

Scripting

Hi all
How do I send a script to a SQL 7 engine?
I want to script a DB backup
Thanks!Hi,
Did you meant to backup a SQL 7 database if yes then login to query analyzer
and execute below script,
BACKUP database <dbname> to disk='d:\backup\dbname.bak' with init
You can also execute the above command using OSQL
OSQL -Usa -Ppass -Sserver (enter)
1> BACKUP database <dbname> to disk='d:\backup\dbname.bak' with init (enter)
2>go (enter)
Did I answered your question?
Thanks
Hari
MCDBA
"steve simpson" <simpsonst3@.comcast.net> wrote in message
news:410aaee7.1203726707@.msnews.microsoft.com...
> Hi all
> How do I send a script to a SQL 7 engine?
> I want to script a DB backup
> Thanks!|||I would like to put this osql script into a PERL (or shell) script.
How'd I do that?
- manzoor|||If you just want to run OSQL in perl, here is one possible syntax.
$execString="-U$user -P$pass -S$server -d$db -i$fullName -n";
$result = `osql $execString`;
Bill
"Manzoorul Hassan" <manzoorul.hassan@.gmail.com> wrote in message
news:1105115335.911230.256540@.z14g2000cwz.googlegroups.com...
>I would like to put this osql script into a PERL (or shell) script.
> How'd I do that?
> - manzoor
>

No comments:

Post a Comment