Using osql with blank sa password

I'm trying to execute a query using osql, however the password for sa is blank and this seems to be causing a problem with osql.  Any suggestions?  Changing the sa password beforehand is not an option.
UsfJamAsked:
Who is Participating?
 
UsfJamAuthor Commented:
actually, my second posting is an answer to my own question.  The statement
osql -SMyServer -Usa -P -dDatabase -q("exit(My sql statement)"
Produces the desired results.
0
 
UsfJamAuthor Commented:
I determined that the problem was caused by the fact that a servername had not been provided in the osql statement.  So when i specified the servername the statement executed ok.  so it looked like this:
osql -SMyServer -Usa -P -dDatabase -q("exit(My sql statement)"
0
 
ChickoCommented:
have you tried
osql -SMyServer -Usa -P'' -dDatabase -q("exit(My sql statement)"

or try ""
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
ChickoCommented:
that looks a big wrong:

I mean ' ' without the space or " " without the space
0
 
ChickoCommented:
it looks like i need to give myself a wedge!!!! Its good to hear you've got the problem sorted, even if it took me a while, i was not at my best that night.
0
 
CleanupPingCommented:
UsfJam:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
ChickoCommented:
hahahh, go on dude, give me the points!! lol. I'll remember the favour.
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.

All Courses

From novice to tech pro — start learning today.