When running this script below I get the following error:
declare @.answer as int
declare @.load_id as int
declare @.dos_command as varchar(500)
set @.load_id = 1
exec @.answer = cp_is_file_ready @.load_id
if (@.answer = 1)
begin
set @.dos_command =
'isql -Sserver -sa -Ppassword -database -Q"exec cp_import_data ' +
convert(varchar(10), @.load_id) + '"'
exec master..xp_cmdshell @.dos_command
end
ERROR MESSAGE:
Msg 18456, Level 14, State 1:
Login failed for user 'sa'.
DB-Library: Login incorrect.
NULL
I checked the sa password and it works for registering the SQL Instance via
the SQL Client and works when connecting to SQL Query Analyzer with it. But
for some reason it blows up when using ISQL.
I am baffled at this point.
Any help is greatly appreciated.Hi,
Replace -U (user) and -P (password) with -E option in ISQL .
I feel the password you enter for the instance is wrong.
Thanks
Hari
MCDBA
"GI" <glenn.illig@.healthtrio.com> wrote in message
news:ej6JV6s1DHA.1752@.tk2msftngp13.phx.gbl...
quote:
> I am using SQL 2000 Named Instance with SP3a on a Windows 2000 Server OS
> When running this script below I get the following error:
> declare @.answer as int
> declare @.load_id as int
> declare @.dos_command as varchar(500)
>
> set @.load_id = 1
>
> exec @.answer = cp_is_file_ready @.load_id
> if (@.answer = 1)
> begin
>
> set @.dos_command =
> 'isql -Sserver -sa -Ppassword -database -Q"exec cp_import_data ' +
> convert(varchar(10), @.load_id) + '"'
> exec master..xp_cmdshell @.dos_command
> end
>
> ERROR MESSAGE:
> Msg 18456, Level 14, State 1:
> Login failed for user 'sa'.
> DB-Library: Login incorrect.
> NULL
>
> I checked the sa password and it works for registering the SQL Instance
via
quote:
> the SQL Client and works when connecting to SQL Query Analyzer with it.
But
quote:|||GI (glenn.illig@.healthtrio.com) writes:
> for some reason it blows up when using ISQL.
> I am baffled at this point.
> Any help is greatly appreciated.
>
>
>
quote:
> I am using SQL 2000 Named Instance with SP3a on a Windows 2000 Server OS
> When running this script below I get the following error:
> declare @.answer as int
> declare @.load_id as int
> declare @.dos_command as varchar(500)
> set @.load_id = 1
> exec @.answer = cp_is_file_ready @.load_id
> if (@.answer = 1)
> begin
> set @.dos_command =
> 'isql -Sserver -sa -Ppassword -database -Q"exec cp_import_data ' +
> convert(varchar(10), @.load_id) + '"'
> exec master..xp_cmdshell @.dos_command
> end
If the instance name is SERVER\INSTANCE, does your command line
actually say -S SERVER\INSTANCE? If you only say -S SERVER, you are
trying to connect to the default instance which may have a
different password.
Rather than hardcoding the server name, it may be better to use the
global variable @.@.servername.
Another possible cause is that the password includes non-ASCII characters.
The will be converted to the OEM charset - or a fallback if not available
in the OEM charset. In any case, using -E is much better, since you don't
have to hardcode the password.
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.aspsql
No comments:
Post a Comment