Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Best way to execute script
Message
De
25/01/1999 17:17:55
 
 
À
25/01/1999 17:00:37
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Installation
Divers
Thread ID:
00177883
Message ID:
00180030
Vues:
33
>>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform