Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
eduinfo
Starting Member
1 Post |
Posted - 2002-01-05 : 13:56:04
|
| Hi is there any way by which i can run the queeires ina text file programmatically |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2002-01-05 : 14:01:51
|
| The osql command line utility was designed specifically to do this. It is documented fully in Books Online, but the general syntax is this (using the C:\mycode.sql file):osql -i "C:\mycode.sql" -Uusername -Ppassword -SservernameIf you want the output of the query to go into a file, you can use the -o switch, but you might be better off using bcp for outputting data into a file, as it is more flexible. |
 |
|
|
|
|
|