Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Calling SQL SERVER backup & restore fro VFP
Message
 
To
07/07/2006 12:04:31
Stephen Hunt
Admit Computer Services Inc.
Farmingdale, New York, United States
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01134436
Message ID:
01134509
Views:
16
>Do you have the exact syntax that you use, I am trying to run osql.exe with paramters to the database and for a password but the SQL EXEC keeps on returning an invalid swith when I pass -S with the server name ?
>
>Thanks Again !

** BackUp
TEXT TO lcSQL NOSHOW PRETEXT 15
         BACKUP DATABASE DATABASE_NAME_HERE TO DISK = ARHIVE_NAME_NERE
                          WITH NOFORMAT, INIT, SKIP, NOREWIND, NOUNLOAD
            BACKUP LOG DATABASE_NAME_HERE WITH NO_LOG
ENDTEXT
IF SQLEXEC(lnSQLh, lcSQL) < 0
   AERROR(laError)
   MessageBox(laError[1,2])
ENDIF
** restore
RESTORE DATABASE DATA_BASE_HERE FROM  DISK = ACTUAL_BACKUP_DISK_FILENAME_HERE
                    WITH  FILE = 1,
                    NOUNLOAD, REPLACE
I have a query that selects last backup and use it for restore, but I am in a hurry. I promise to send it to you on sunday evening when I get back.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform