View Single Post
Old 10th November 2004, 17:21   #6
bgosalci
Guest
 
Posts: n/a
How would I execute the following commandline command using nsExec::Exec:

'osql -E -SserverName\LA \
RESTORE DATABASE MyDatabase \
FROM DISK = 'C:\LA\MSDE 2000A\Backup\MyDatabase ' \
WITH RECOVERY, \
MOVE "MyDatabase_Data" TO "C:\LA\MSDE 2000A\MSSQL$LA\Data\MyDatabase.mdf", \
MOVE "MyDatabase_Log" TO "C:\LA\MSDE 2000A\MSSQL$LA\Data\MyDatabase.ldf" \
GO'

Is it simply executed as follows:

nsExec::Exec 'osql -E -SserverName\LA \
RESTORE DATABASE MyDatabase \
FROM DISK = 'C:\LA\MSDE 2000A\Backup\MyDatabase ' \
WITH RECOVERY, \
MOVE "MyDatabase_Data" TO "C:\LA\MSDE 2000A\MSSQL$LA\Data\MyDatabase.mdf", \
MOVE "MyDatabase_Log" TO "C:\LA\MSDE 2000A\MSSQL$LA\Data\MyDatabase.ldf" \
GO'
  Reply With Quote