473,387 Members | 1,520 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Will OSQL Produce SQL Backup?

Will osql product an SQL backup? By this I mean a text file with the
transact-sql in it so I can use it to recreate the database elsewhere?
Thank you.

Jul 23 '05 #1
1 1999

<jo*************@yahoo.com> wrote in message
news:11*********************@l41g2000cwc.googlegro ups.com...
Will osql product an SQL backup? By this I mean a text file with the
transact-sql in it so I can use it to recreate the database elsewhere?
Thank you.


No - if you want to generate .sql scripts to recreate a database and its
objects, you need to use Enterprise Manager or Query Analyzer, or write your
own code to use the SQLDMO API. But if you just want to backup the database
to a backup file, so you can restore it later, then yes:

osql -S MyServer -E -Q"backup database MyDB to disk = 'c:\temp\mydb.bak'"

Then copy mydb.bak to the target server and restore it:

osql -S MyServer -E -Q"restore database MyDB from disk = 'c:\temp\mydb.bak'"

You might find these links helpful (I'm guessing you have MSDE since you
want to use osql.exe specifically):

http://support.microsoft.com/default...b;en-us;314546
http://www.aspfaq.com/show.asp?id=2442

Simon
Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Ajay Garg | last post by:
I am running the following OSQL command and capturing the return code for the error .Whenver i have an error like server not exists or uable to login I get a return code of 1 for the...
2
by: second714 | last post by:
Hi, I have several big tables with rows more than 25 mil rows and to update/delete/insert data in these tables, it can take minutes. I use BULK Insert/DELETE/Update with osql. While I run one of...
24
by: LineVoltageHalogen | last post by:
Greetings All, I was hoping that someone out there has run into this issue before and can shed some light on it for me. I have a stored procedure that essentially does a mini ETL from a source...
1
by: Tiago Costa | last post by:
I want to call a OSQL command to BackUp my data base, how can i call it from Visual Studio (C#) 2003. Thanks In Advance, Tiago Costa
4
by: Zeya | last post by:
I am executing OSQL using System.Diagnostic.Process with the following parameters: -S <servername> -E -Q "BACKUP DATABASE <databasename> to DISK='E:\Temp\Now.bak'" This works from command...
2
by: | last post by:
Hi, I have just started using MSSQL and the DOS environment at work. I have a lot of experience with Sybase and the UNIX environment, but this is a whole new ball of wax. I'd like to use osql...
7
by: gopal | last post by:
Hi, I have a console application whose purpose is to run the OSQL utility from my console application. When my application is run, the OSQL utility is started and it has to prompt for...
5
by: gopal | last post by:
Hi I am running a OSQL utility from my console application . iam trying to install a huge SQL file of 5MB, i debugged my code and the application is not responding at the following line of code...
6
by: chazzy69 | last post by:
Im currently using a php script to access a database and use the following lines to produce a backup of a table- $query = "SELECT * INTO OUTFILE 'test.sql' FROM `default_en_listingsdbelements`";...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.