Wednesday, March 28, 2012

running a stored procedure from one server to access jobs on another

I have two servers linked. I can run an SP on one server to access jobs on
the other server. I cannot make this work the other way around?
this works from server1
server2.msdb..sp_update_job @.job_name = 'Copy And Restore FFICDB Trans
Logs',@.enabled =1
This fails with the error msg Could not connect to server 'server1' because
'sa' is not defined as a remote login at the server.
server1.msdb..sp_update_job @.job_name = 'Copy And Restore FFICDB Trans
Logs',@.enabled =1Did you map logins from server 2 to server 1? Also, it seems you login as sa on server 2, I never
recommend anyone logging in as sa.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Andy Phillips" <andy.phillips@.callatg.com> wrote in message
news:%23eH52BB2EHA.3820@.TK2MSFTNGP11.phx.gbl...
> I have two servers linked. I can run an SP on one server to access jobs on
> the other server. I cannot make this work the other way around?
> this works from server1
> server2.msdb..sp_update_job @.job_name = 'Copy And Restore FFICDB Trans
> Logs',@.enabled =1
> This fails with the error msg Could not connect to server 'server1' because
> 'sa' is not defined as a remote login at the server.
> server1.msdb..sp_update_job @.job_name = 'Copy And Restore FFICDB Trans
> Logs',@.enabled =1
>|||Do you have a linked server set up on both servers? A linked server only
works in one direction. You need a linked server set up on both servers to be
able to go both ways.
"Andy Phillips" wrote:
> I have two servers linked. I can run an SP on one server to access jobs on
> the other server. I cannot make this work the other way around?
> this works from server1
> server2.msdb..sp_update_job @.job_name = 'Copy And Restore FFICDB Trans
> Logs',@.enabled =1
> This fails with the error msg Could not connect to server 'server1' because
> 'sa' is not defined as a remote login at the server.
> server1.msdb..sp_update_job @.job_name = 'Copy And Restore FFICDB Trans
> Logs',@.enabled =1
>
>|||All I did was link the servers.Please explain what I should do.
Thanks
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:Obs8SCE2EHA.2568@.TK2MSFTNGP11.phx.gbl...
> Did you map logins from server 2 to server 1? Also, it seems you login as
sa on server 2, I never
> recommend anyone logging in as sa.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Andy Phillips" <andy.phillips@.callatg.com> wrote in message
> news:%23eH52BB2EHA.3820@.TK2MSFTNGP11.phx.gbl...
> > I have two servers linked. I can run an SP on one server to access jobs
on
> > the other server. I cannot make this work the other way around?
> >
> > this works from server1
> > server2.msdb..sp_update_job @.job_name = 'Copy And Restore FFICDB Trans
> > Logs',@.enabled =1
> >
> > This fails with the error msg Could not connect to server 'server1'
because
> > 'sa' is not defined as a remote login at the server.
> >
> > server1.msdb..sp_update_job @.job_name = 'Copy And Restore FFICDB Trans
> > Logs',@.enabled =1
> >
> >
>|||If you use EM, right.click the linked server, Properties, and the security tab. Map the login there.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Andy Phillips" <andy.phillips@.callatg.com> wrote in message
news:%23ogJfYJ2EHA.2624@.TK2MSFTNGP11.phx.gbl...
> All I did was link the servers.Please explain what I should do.
> Thanks
>
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
> message news:Obs8SCE2EHA.2568@.TK2MSFTNGP11.phx.gbl...
> > Did you map logins from server 2 to server 1? Also, it seems you login as
> sa on server 2, I never
> > recommend anyone logging in as sa.
> >
> > --
> > Tibor Karaszi, SQL Server MVP
> > http://www.karaszi.com/sqlserver/default.asp
> > http://www.solidqualitylearning.com/
> >
> >
> > "Andy Phillips" <andy.phillips@.callatg.com> wrote in message
> > news:%23eH52BB2EHA.3820@.TK2MSFTNGP11.phx.gbl...
> > > I have two servers linked. I can run an SP on one server to access jobs
> on
> > > the other server. I cannot make this work the other way around?
> > >
> > > this works from server1
> > > server2.msdb..sp_update_job @.job_name = 'Copy And Restore FFICDB Trans
> > > Logs',@.enabled =1
> > >
> > > This fails with the error msg Could not connect to server 'server1'
> because
> > > 'sa' is not defined as a remote login at the server.
> > >
> > > server1.msdb..sp_update_job @.job_name = 'Copy And Restore FFICDB Trans
> > > Logs',@.enabled =1
> > >
> > >
> >
> >
>|||I cannot link the other server. It sys it already exists although it shows
no items in the list?
"Robert Davis" <RobertDavis@.discussions.microsoft.com> wrote in message
news:59EB1C48-4211-4D42-BC9E-79D354C5C3B6@.microsoft.com...
> Do you have a linked server set up on both servers? A linked server only
> works in one direction. You need a linked server set up on both servers to
be
> able to go both ways.
> "Andy Phillips" wrote:
> > I have two servers linked. I can run an SP on one server to access jobs
on
> > the other server. I cannot make this work the other way around?
> >
> > this works from server1
> > server2.msdb..sp_update_job @.job_name = 'Copy And Restore FFICDB Trans
> > Logs',@.enabled =1
> >
> > This fails with the error msg Could not connect to server 'server1'
because
> > 'sa' is not defined as a remote login at the server.
> >
> > server1.msdb..sp_update_job @.job_name = 'Copy And Restore FFICDB Trans
> > Logs',@.enabled =1
> >
> >
> >|||It'sa fixed. Thanks Robert. I had to remove remote servers and linked
servers and then relink them. I have links each way now and all is working
top. Thanks
"Andy Phillips" <andy.phillips@.callatg.com> wrote in message
news:uFGWTEC3EHA.3932@.TK2MSFTNGP12.phx.gbl...
> I cannot link the other server. It sys it already exists although it shows
> no items in the list?
>
> "Robert Davis" <RobertDavis@.discussions.microsoft.com> wrote in message
> news:59EB1C48-4211-4D42-BC9E-79D354C5C3B6@.microsoft.com...
> > Do you have a linked server set up on both servers? A linked server only
> > works in one direction. You need a linked server set up on both servers
to
> be
> > able to go both ways.
> >
> > "Andy Phillips" wrote:
> >
> > > I have two servers linked. I can run an SP on one server to access
jobs
> on
> > > the other server. I cannot make this work the other way around?
> > >
> > > this works from server1
> > > server2.msdb..sp_update_job @.job_name = 'Copy And Restore FFICDB
Trans
> > > Logs',@.enabled =1
> > >
> > > This fails with the error msg Could not connect to server 'server1'
> because
> > > 'sa' is not defined as a remote login at the server.
> > >
> > > server1.msdb..sp_update_job @.job_name = 'Copy And Restore FFICDB
Trans
> > > Logs',@.enabled =1
> > >
> > >
> > >
>

No comments:

Post a Comment