Using OSQL to run queries against the Backup Exec for Windows Servers Database (BEDB)

Article:TECH31189  |  Created: 2004-01-19  |  Updated: 2011-10-05  |  Article URL http://www.symantec.com/docs/TECH31189
Article Type
Technical Solution

Product(s)

Environment

Issue



Using OSQL to run queries against the Backup Exec for Windows Servers Database (BEDB)


Solution




To run a SQL Query against the Backup Exec for Windows Servers Database (BEDB) without using SQL Query Analyzer, you can use an application that is packaged with MSDE called OSQL as follows:


 
1. First, create the SQL Query and save it as a text file (although any extension can be used).  This file can be called anything.  For the purpose of this document the example will use SQL.TXT.  
 

 
2. Next, open a command prompt and change to the directory where the query text file was saved.  
 

 
3. Then type in the following command:
 

 
osql -S <computername>\bkupexec -dbedb -E -i sql.txt
 

 
This will run the query(s) in the text file that was created.
 

To see a full listing of all osql switch parameters and their functions simply enter "osql -?"

 



Legacy ID



266780


Article URL http://www.symantec.com/docs/TECH31189


Terms of use for this information are found in Legal Notices