Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Using osql with blank sa password

Posted on 2002-06-24
8
Medium Priority
?
945 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

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

I have a large data set and a SSIS package. How can I load this file in multi threading?
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Viewers will learn how the fundamental information of how to create a table.

705 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