Solved

Using osql with blank sa password

Posted on 2002-06-24
8
855 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
Comment Utility
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
Comment Utility
have you tried
osql -SMyServer -Usa -P'' -dDatabase -q("exit(My sql statement)"

or try ""
0
 
LVL 2

Expert Comment

by:Chicko
Comment Utility
that looks a big wrong:

I mean ' ' without the space or " " without the space
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

Accepted Solution

by:
UsfJam earned 0 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
hahahh, go on dude, give me the points!! lol. I'll remember the favour.
0

Featured Post

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

Suggested Solutions

I wrote this interesting script that really help me find jobs or procedures when working in a huge environment. I could I have written it as a Procedure but then I would have to have it on each machine or have a link to a server-related search that …
Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

743 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now