Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Using osql with blank sa password

Posted on 2002-06-24
8
Medium Priority
?
967 Views
Last Modified: 2008-02-26
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.
0
Comment
Question by:UsfJam
  • 4
  • 2
8 Comments
 

Author Comment

by:UsfJam
ID: 7104192
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
 
LVL 2

Expert Comment

by:Chicko
ID: 7107467
have you tried
osql -SMyServer -Usa -P'' -dDatabase -q("exit(My sql statement)"

or try ""
0
 
LVL 2

Expert Comment

by:Chicko
ID: 7107469
that looks a big wrong:

I mean ' ' without the space or " " without the space
0
Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

 

Accepted Solution

by:
UsfJam earned 0 total points
ID: 7108424
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
 
LVL 2

Expert Comment

by:Chicko
ID: 7113463
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
 

Expert Comment

by:CleanupPing
ID: 9280254
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
 
LVL 2

Expert Comment

by:Chicko
ID: 9286533
hahahh, go on dude, give me the points!! lol. I'll remember the favour.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
This month, Experts Exchange sat down with resident SQL expert, Jim Horn, for an in-depth look into the makings of a successful career in SQL.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question