Re: schedule job - login in dynamic sql
From: Quentin Ran (ab_at_who.com)
Date: 03/23/04
- Next message: Tim: "Expire Passwords"
- Previous message: Hugo Kornelis: "Re: Row Count"
- In reply to: kriste: "Re: schedule job - login in dynamic sql"
- Next in thread: kriste: "Re: schedule job - login in dynamic sql"
- Reply: kriste: "Re: schedule job - login in dynamic sql"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 23 Mar 2004 14:55:35 -0600
Kriste,
a few userids are involved here.
(owner of the stored proc: this part can be skipped if you are not playing
too much with the schema. If the user created the stored proc without
specifying proper ownership, other users will not be able to execute it.)
You have a userid as the login on the server. You login and run the stored
proc which involves a linked server. Here you have to have given your login
the access to the linked server.
When you run the same stored proc from the server by a job, the user who
runs the job and also then the stored proc is the userid under which SQL
Server Agent Service runs. So you need to give exec permission of the
stored proc to the Agent userid (normally not needed explicitly, since
usually the Agent userid is a member of the sysadmin, or at least of dbo),
then you need to give this Agent userid access to the linked server, then
you need to give this agent userid access to the objects in the db on the
linked server you are accessing.
Since mostly the server agent userid is a domain user, and if the security
is set up as the mostly used default, things should work. If not, you need
to check this line of security. Where the permission is not set right, it
will break. You can test this step by step, use the agent account, starting
from local and extend to the linked server.
Quentin
"kriste" <kriste_l@hotmail.com> wrote in message
news:ukRnkqOEEHA.1544@TK2MSFTNGP09.phx.gbl...
> Can someone pls help me out on this?
>
>
> "kriste" <kriste_l@hotmail.com> wrote in message
> news:uhl8NHKEEHA.3016@TK2MSFTNGP11.phx.gbl...
> > Hi Greg,
> >
> > This is how I setup the link server.. I create the link server @ SQL-EM
> and
> > entered the id/password.
> > At the query, I was able to call up and access the link server.
> >
> > Eg. Server A, link server B.
> > I have a job in server A where it includes 2 steps, on succeed of step
1,
> > step 2 that use the
> > dynamic sql (embedded with link server B) will be run. The problem now
is
> I
> > have id/password problem in running step 2.
> >
> > I don't understand what do u mean by openrowset. This is a sp and not
> > calling from program to do updating.
> >
> >
> > "Greg Obleshchuk" <greg-n-o-s-p-a-m-@ag-s-o-f-t-w-a-r-e.com> wrote in
> > message news:%23kaZbgJEEHA.3256@TK2MSFTNGP09.phx.gbl...
> > > Hi,
> > > The schedular is not doubt run with a different password than your
user
> > (via
> > > QA). You link server sounds like it is set-up to pass through current
> > User
> > > ID.
> > > You can set up the link server to use a single User ID and password
but
> > that
> > > would mean that anyone using that linked server would have the same
> access
> > > (Which might be update and something you might not want)
> > >
> > > You could always try using openrowset, which allows you to pass the
USER
> > ID
> > > and password through to the other server and doesn't require a linked
> > server
> > > entry.
> > >
> > > regards
> > > Greg
> > >
> > >
> > > "kriste" <kriste_l@hotmail.com> wrote in message
> > > news:#yo1GgIEEHA.3424@tk2msftngp13.phx.gbl...
> > > Hi,
> > >
> > > I've created a sp that used dynamic sql and embedded with linked
server
> > > name. It was tested working @ the query analyser.
> > > But when that was placed in the schedule job to be run, it give error
> that
> > > login/password was incorrect.
> > >
> > > Both my servers maintained difference set of login/password. Can
someone
> > > highlight me how should I set the login/password that sp in the job?
> > >
> > > thx.
> > >
> > >
> >
> >
>
>
- Next message: Tim: "Expire Passwords"
- Previous message: Hugo Kornelis: "Re: Row Count"
- In reply to: kriste: "Re: schedule job - login in dynamic sql"
- Next in thread: kriste: "Re: schedule job - login in dynamic sql"
- Reply: kriste: "Re: schedule job - login in dynamic sql"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|