Home All Groups Group Topic Archive Search About

Login failed when I execute a job with the command BCP out

Author
19 Oct 2006 8:49 AM
Juanjo
Hello,

As I have already posted in this news group I am working on a SQL 2000
server Log shipping system. And I have found a new issue with one of the jobs
needed for the role change.

This is the command needed in the job for the syslogins transfer to the
secondary database:

“BCP master..syslogins out
%BACKUP%:\SQLBackup\MSSQL$<instance_name>\LOGSHIPPING\syslogins.dat /N /S
<primary_server_name\instance_name> /U sa /P <sa_password>”

When I execute this job I get the following error:
"SQLState = 28000, NativeError = 18452
Error = [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user
'sa'. Reason: Not associated with a trusted SQL Server connection."

Even if I use a domain account instead the sa account I get this Login
failed error.

I can only execute this job if I set database security to "SQL Server and
Windows authentication"

Does anyone have seen this before? What should I change to be able to
execute this job only with Windows authentication?

Thank you very much for your help.

Best regards,
Juanjo

Author
19 Oct 2006 9:27 AM
Tibor Karaszi
Replace below
/U sa /P...

With:
/T

Show quoteHide quote
"Juanjo" <Jua***@discussions.microsoft.com> wrote in message
news:E6425289-EB34-47CF-8509-756B3A2B6C0C@microsoft.com...
> Hello,
>
> As I have already posted in this news group I am working on a SQL 2000
> server Log shipping system. And I have found a new issue with one of the jobs
> needed for the role change.
>
> This is the command needed in the job for the syslogins transfer to the
> secondary database:
>
> "BCP master..syslogins out
> %BACKUP%:\SQLBackup\MSSQL$<instance_name>\LOGSHIPPING\syslogins.dat /N /S
> <primary_server_name\instance_name> /U sa /P <sa_password>"
>
> When I execute this job I get the following error:
> "SQLState = 28000, NativeError = 18452
> Error = [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user
> 'sa'. Reason: Not associated with a trusted SQL Server connection."
>
> Even if I use a domain account instead the sa account I get this Login
> failed error.
>
> I can only execute this job if I set database security to "SQL Server and
> Windows authentication"
>
> Does anyone have seen this before? What should I change to be able to
> execute this job only with Windows authentication?
>
> Thank you very much for your help.
>
> Best regards,
> Juanjo
Are all your drivers up to date? click for free checkup

Author
24 Oct 2006 7:48 AM
Juanjo
Hi Tibor,

Your are right I should use /T. It is working now.

Thank you very much for your help.

Cheers,
Juanjo




Show quoteHide quote
"Tibor Karaszi" wrote:

> Replace below
> /U sa /P...
>
> With:
> /T
>
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
>
> "Juanjo" <Jua***@discussions.microsoft.com> wrote in message
> news:E6425289-EB34-47CF-8509-756B3A2B6C0C@microsoft.com...
> > Hello,
> >
> > As I have already posted in this news group I am working on a SQL 2000
> > server Log shipping system. And I have found a new issue with one of the jobs
> > needed for the role change.
> >
> > This is the command needed in the job for the syslogins transfer to the
> > secondary database:
> >
> > "BCP master..syslogins out
> > %BACKUP%:\SQLBackup\MSSQL$<instance_name>\LOGSHIPPING\syslogins.dat /N /S
> > <primary_server_name\instance_name> /U sa /P <sa_password>"
> >
> > When I execute this job I get the following error:
> > "SQLState = 28000, NativeError = 18452
> > Error = [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user
> > 'sa'. Reason: Not associated with a trusted SQL Server connection."
> >
> > Even if I use a domain account instead the sa account I get this Login
> > failed error.
> >
> > I can only execute this job if I set database security to "SQL Server and
> > Windows authentication"
> >
> > Does anyone have seen this before? What should I change to be able to
> > execute this job only with Windows authentication?
> >
> > Thank you very much for your help.
> >
> > Best regards,
> > Juanjo
>
>
>

Bookmark and Share

Post Thread options