472,122 Members | 1,520 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

restore from command line

I want to restore a backup copy of a database from the command line. Can
this be done?

Thanks, Tom.
Jul 23 '05 #1
2 11599
You can use osql.exe - something like this:

osql.exe -S MyServer -E -Q"restore database MyDB from ..."

See osql and RESTORE in Books Online.

Simon

Jul 23 '05 #2
Simon Hayes wrote:
You can use osql.exe - something like this:

osql.exe -S MyServer -E -Q"restore database MyDB from ..."

See osql and RESTORE in Books Online.

Simon

Thanks for that.

osql.exe -S MyServer -E -Q"RESTORE DATABASE MyDB FROM disk = '\\MyServer
\my Backups\the backup'"

Works great.

Tom.
Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Spieg | last post: by
13 posts views Thread by Andy K | last post: by
11 posts views Thread by Chris | last post: by
reply views Thread by leo001 | last post: by

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.