Solved

Using osql with blank sa password

Posted on 2002-06-24
8
892 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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 

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

Database Solutions Engineer FAQs

In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller single-server environments.

Question has a verified solution.

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

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
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.
Viewers will learn how the fundamental information of how to create a table.

623 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