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

This is the batch file. but after I run the OSQL -S 127.0.0.1 -U sa -P password, the dos command start with the line

1> 

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

link|improve this question
feedback

1 Answer

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

link|improve this answer
feedback

Your Answer

 
or
required, but never shown