Solved

Cannot using OSQL to connect to a database on remote server

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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

I am showing a way to read/import the excel data in table using SQL server 2005... Suppose there is an Excel file "Book1" at location "C:\temp" with column "First Name" and "Last Name". Now to import this Excel data into the table, we will use…
In SQL Server, when rows are selected from a table, does it retrieve data in the order in which it is inserted?  Many believe this is the case. Let us try to examine for ourselves with an example. To get started, use the following script, wh…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

777 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