Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.