dell1
SSC-Addicted
Points: 432
More actions
May 28, 2004 at 9:21 am
#359823
I need to create an osql script to restore a database. ie use commandprompt
How can this be done. examples etc....
Amit Jethva
SSCarpal Tunnel
Points: 4707
May 31, 2004 at 2:40 am
#508354
the osql scripts are nothing but TSQL statments called from command prompt. Build your restore command and call it with osql.
e.g.
osql -E -S . -Q "select @@version"
osql -E -S . -Q "RESTORE DATABASE DB FROM DISK=N'c:\abc.bak' "
-- Amit
Steve Jones - SSC Editor
SSC Guru
Points: 736270
May 31, 2004 at 9:21 am
#508414
Test your restore in QA, then take the script adn put it in the -Q parameter as shown by Amit above.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply