469,106 Members | 2,353 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,106 developers. It's quick & easy.

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 11514
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
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.