WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Webmaster, IT and Security Discussion > Database Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

Database Discussion Forum This is the place to find help resolving those nagging questions you have about implementing and using all kinds of databases. Need help writing a query? Need an opinion on Oracle? Post here!

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-06-2004, 04:30 PM
WebProWorld New Member
 

Join Date: Mar 2004
Posts: 18
DavidatWork RepRank 0
Default .bat file to export sql 7.0 database

Hi,
Does anyone know where to get info on how to write a .bat file that will stop a sql 7.0 database / export the data to a file then restart the database? Im trying to do this so I can get a complete database file for our backup process.

Thanks for any help you might have.

regards,
DavidatWork
Reply With Quote
  #2 (permalink)  
Old 04-07-2004, 03:19 AM
sijpie's Avatar
WebProWorld Pro
 

Join Date: Sep 2003
Location: Scotland
Posts: 108
sijpie RepRank 0
Default

Oh, this is going back a few years, but it is exactly what I used to do.

You can't access the database directly from DOS, but the way it works is that the batch file calls the command line SQL programme and then tell it to take its input from a file rather then from the keyboard.

So first you need to record exactly the keystrokes that you use if you were to do it manually, including the logging in, and quiting, etc, etc. (remember that once running it will not take any keyboard input!!)

This you enter into a text file, save it as say backup.inp

if we assume that the SQL command-line programme is sqlbase.exe, then you write your batch file, which is pretty simple:

sqlbase.exe < backup.inp

That's it!
This calls sqlbase.exe and tells it to read input from backup.inp

I would suggest to start off with an easy input file, just logging in, and quitting. Then build it up.
__________________
Jaap

PalmVenue
Broekhuizen Paintings
MacSijp

You've done it all
You've broken every code (Steve Harley)
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Database Discussion Forum
Tags: , , , ,



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Search Engine Optimization by vBSEO 3.2.0