Solved

Cannot using OSQL to connect to a database on remote server

Posted on 2010-09-14
5
784 Views
Last Modified: 2012-05-10
Hi;

My Server A is hosting a database in SQL 2005 64 bit and the "Allow Remote Connection" is ON on the Server A, however on Server B, when I tried to use OSQL to access and login to the server A database via ODBC, it does not work.  I test the ODBC connection on Server B, it works fine.  Any idea?  Server B is my app server which will call osql in a batch program to backup the database in Server A.

I used this syntax, "osql -U sa -P password -D ODBCtoServerA

But the result is..


Login failed for user "sa"
0
Comment
Question by:KANEWONG
[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
  • 2
  • 2
5 Comments
 
LVL 39

Expert Comment

by:BrandonGalderisi
ID: 33675371
What error or message do you get?
0
 
LVL 1

Expert Comment

by:innosys
ID: 33675374
try to identify linked server it will works
0
 
LVL 1

Author Comment

by:KANEWONG
ID: 33675489
But if "-D ODBCtoServerA" command has specify how to and what server to connect?
0
 
LVL 1

Author Comment

by:KANEWONG
ID: 33676496
I tried with this command and it prompt me 1> after I enter the password ... what is that mean?

osql -S ServerA -U sa
Password:
1>
0
 
LVL 39

Accepted Solution

by:
BrandonGalderisi earned 250 total points
ID: 33676545
If you have a blank password, which I PRAY you don't, just enter -P in the command line with no value after it.
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

This article will describe one method to parse a delimited string into a table of data.   Why would I do that you ask?  Let's say that you need to pass multiple parameters into a stored procedure to search for.  For our sake, we'll say that we wa…
So every once in a while at work I am asked to export data from one table and insert it into another on a different server.  I hate doing this.  There's so many different tables and data types.  Some column data needs quoted and some doesn't.  What …

730 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