Solved

Cannot using OSQL to connect to a database on remote server

Posted on 2010-09-14
5
768 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
  • 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

There are some very powerful Data Management Views (DMV's) introduced with SQL 2005. The two in particular that we are going to discuss are sys.dm_db_index_usage_stats and sys.dm_db_index_operational_stats.   Recently, I was involved in a discu…
Introduction: When running hybrid database environments, you often need to query some data from a remote db of any type, while being connected to your MS SQL Server database. Problems start when you try to combine that with some "user input" pass…
This video discusses moving either the default database or any database to a new volume.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

762 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

20 Experts available now in Live!

Get 1:1 Help Now