472,334 Members | 1,534 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,334 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 1945

<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):


Jul 23 '05 #2

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

Similar topics

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...
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...
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...
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
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...
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...
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...
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...
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...
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...

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.