Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Best way to execute script
Message
From
25/01/1999 17:17:55
 
 
General information
Forum:
Microsoft SQL Server
Category:
Installation
Miscellaneous
Thread ID:
00177883
Message ID:
00180030
Views:
34
>>On a weekly basis, we have to update our SQL Server from another SQL Server. We receive a script file to define the tables and a backup to restore the data.
>>
>>What would be the best way to execute the script and restore the data without having to go into SQL Server Enterprise Manager?
>
>What about using osql.exe. You could tell it to run the script and then do the restore.
>
>osql -Sserver -ddatabase -E -iscriptfile -ooutputfile
>osql -Sserver -ddatabase -E -Q"restore database dbname from disk='path/file.dat'
>
>Or something like that. You might have to use the MOVE option if the database files in the backup don't have the same physical name and path that the target database files do.

That's good.

Is the -o parameter to keep a log?

What is the -e parameter?
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform