2

This is the batch file:

OSQL -S 127.0.0.1 -U sa -P password
RESTORE DATABASE DATA FROM DISK = C:\backup\data.dat
GO
EXIT

But after I run the OSQL -S 127.0.0.1 -U sa -P password, the command prompt starts with the line:

1> 

After that, the batch cmd can't run. How can I fix this problem?

0

after reading 'Running the osql Utility' i would use

% osql -S 127.0.0.1 -U sa -P password -i myscript.sql

and put

RESTORE DATABASE DATA FROM DISK = C:\backup\data.dat
GO
EXIT

into a file named myscript.sql

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy