• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 606
  • Last Modified:

executing osql.exe

I am using osql command to execute a batch file to update my database

@echo off
osql.exe -d dbname -U username -P password -i C:\Program Files\Test Systems\Application Windows\Working\Batchfile.sql -Q


I am not sure to whether the command is executed correctly. Is it possible to write the output in a text file or see the result window?

Thanks in advance for your help
0
veshan
Asked:
veshan
  • 2
1 Solution
 
Jan FranekCommented:
Try this:

osql.exe -d dbname -U username -P password -i C:\Program Files\Test Systems\Application Windows\Working\Batchfile.sql -o C:\Program Files\Test Systems\Application Windows\Working\Batchfile.log -Q
0
 
veshanAuthor Commented:
Thanks a lot.
Does blank spaces (C:\Program Files\Application Windows\...\ in the file path ?
0
 
Jan FranekCommented:
Yes, the blank spaces could cause you a problem - enclose it in ":

osql.exe -d dbname -U username -P password -i "C:\Program Files\Test Systems\Application Windows\Working\Batchfile.sql" -o "C:\Program Files\Test Systems\Application Windows\Working\Batchfile.log" -Q
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now