Thursday, March 8, 2012

can connect using sql query analyzer but not osql or isql

I have a SQL server 2000 enterprise edition installed on windows 2000
advanced server. It starts successfully and using SQL query analyzer, I can
connect to it using windows authentication and execute sql statements without
a problem.
But when I used isql (either just isql or isql [-U login id]), I got the
following error message:
Msg 18456, Level 14, State 1:
Login failed for user 'Administrator'.
DB-Library: Login incorrect.
If I use osql,
I got:
Login failed for user 'Administrator'.
Weirdly, NO logon information is recorded in ERRORLOG.
In SQL query analyzer, I used the login id Administrator, which is what I
used to login to Windows.
After installation of sql server, we changed the password of Windows
Administrator account, so there might be a password mismatch. But I can use
the new password
to connect to sql server in SQL query analyzer, but not osql or isql.
I tried osql and isql with both the new password and the old one(not sure if
it is correct), but neither of them worked.
What might be the cause?
Thank you very much,
I think you're confusing Windows authentication with SQL
authentication. When you try connecting with osql try the -E (trusted
login) parameter rather than -U Administrator. With Windows
authentication you don't specify a password as the windows security
token for your windows account is used instead (which has already been
authenticated by a domain controller).
*mike hodgson*
http://sqlnerd.blogspot.com
Tammy wrote:

>I have a SQL server 2000 enterprise edition installed on windows 2000
>advanced server. It starts successfully and using SQL query analyzer, I can
>connect to it using windows authentication and execute sql statements without
>a problem.
>But when I used isql (either just isql or isql [-U login id]), I got the
>following error message:
>Msg 18456, Level 14, State 1:
>Login failed for user 'Administrator'.
>DB-Library: Login incorrect.
>If I use osql,
>I got:
>Login failed for user 'Administrator'.
>Weirdly, NO logon information is recorded in ERRORLOG.
>In SQL query analyzer, I used the login id Administrator, which is what I
>used to login to Windows.
>After installation of sql server, we changed the password of Windows
>Administrator account, so there might be a password mismatch. But I can use
>the new password
>to connect to sql server in SQL query analyzer, but not osql or isql.
>I tried osql and isql with both the new password and the old one(not sure if
>it is correct), but neither of them worked.
>What might be the cause?
>Thank you very much,
>
>
|||It works! Thank you, Mike.
"Mike Hodgson" wrote:

> I think you're confusing Windows authentication with SQL
> authentication. When you try connecting with osql try the -E (trusted
> login) parameter rather than -U Administrator. With Windows
> authentication you don't specify a password as the windows security
> token for your windows account is used instead (which has already been
> authenticated by a domain controller).
> --
> *mike hodgson*
> http://sqlnerd.blogspot.com
>
> Tammy wrote:
>

No comments:

Post a Comment