How to save one query result into one file?

luyan
luyan used Ask the Experts™
on
I run one query and would like to save the result to one file. I could use osql or bcp to realize it. But osql and bcp will need to put user account and password there like -Uusername -Ppassword. It's not safe. Could I get the query result by one SQL command?
Thanks!
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
I got answer by myself. I could use silent way for running osql.
Thanks!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial