Showing posts with label jobs. Show all posts
Showing posts with label jobs. Show all posts

Sunday, March 25, 2012

ActiveX Script Task/Function Not Found

We have a SQL Server 2005 Cluster that we are trying to send email from to notify when certain jobs have completed, failed, etc. We are having a bit of a problem getting the email to work and I believe that the failure is at the SMTP server, not at the SQL level.

That being said, I'm trying to create a simple SSIS package that I can use to test connectivity to the SMTP server with and send email. I've added an ActiveX Script Task that calls a COM object that actually sends the email. I keep getting a "Function not found." error when I try to execute the package, and I have no idea why I'm getting that. It says that the errors were found during validation.

Can anyone help?

Function not found is most likely the result of an invalid reference.

However, we do not recommend using the ActiveX script task - it is only for backwards compat. Better to move to the Script task which uses VB.Net and which enables a much better development and debugging experience.

Donald

activex script jobs

Can anyone tell me why I get this error when trying to run a job on sql 2005
that is an activex script?
Error creating security descriptor for shared objects (reason: No mapping
between account names and security IDs was done). The
step failed.
I even tried credentials, proxy accounts etc. I might need to have a good
instruction sheet to explain how to properly set this up.
Please give more information about the owner of the job, agent service
account details and also the configuration (like OS/SP/Language/cluster?)
In SQL2005, Activex Script subsystem is executed in separate process context
and not anymore in SQLAgent process context.
This issue you are refering was known one in non-English locale and cluster
config in our Beta releases, but has been addressed in our RTM.
I am assuming you are using RTM version of SQL2005, please confirm. If you
are using pre-RTM version, upgrade to RTM and you should see this addressed
Thanks,
Gops Dwarak
"ECS" <ecs@.netset.com> wrote in message
news:OogfHMT$FHA.1256@.TK2MSFTNGP15.phx.gbl...
> Can anyone tell me why I get this error when trying to run a job on sql
2005
> that is an activex script?
> Error creating security descriptor for shared objects (reason: No mapping
> between account names and security IDs was done). The
> step failed.
>
> I even tried credentials, proxy accounts etc. I might need to have a good
> instruction sheet to explain how to properly set this up.
>
sql

activex script jobs

Can anyone tell me why I get this error when trying to run a job on sql 2005
that is an activex script?
Error creating security descriptor for shared objects (reason: No mapping
between account names and security IDs was done). The
step failed.
I even tried credentials, proxy accounts etc. I might need to have a good
instruction sheet to explain how to properly set this up.Please give more information about the owner of the job, agent service
account details and also the configuration (like OS/SP/Language/cluster?)
In SQL2005, Activex Script subsystem is executed in separate process context
and not anymore in SQLAgent process context.
This issue you are refering was known one in non-English locale and cluster
config in our Beta releases, but has been addressed in our RTM.
I am assuming you are using RTM version of SQL2005, please confirm. If you
are using pre-RTM version, upgrade to RTM and you should see this addressed
Thanks,
Gops Dwarak
"ECS" <ecs@.netset.com> wrote in message
news:OogfHMT$FHA.1256@.TK2MSFTNGP15.phx.gbl...
> Can anyone tell me why I get this error when trying to run a job on sql
2005
> that is an activex script?
> Error creating security descriptor for shared objects (reason: No mapping
> between account names and security IDs was done). The
> step failed.
>
> I even tried credentials, proxy accounts etc. I might need to have a good
> instruction sheet to explain how to properly set this up.
>

activex script jobs

Can anyone tell me why I get this error when trying to run a job on sql 2005
that is an activex script?
Error creating security descriptor for shared objects (reason: No mapping
between account names and security IDs was done). The
step failed.
I even tried credentials, proxy accounts etc. I might need to have a good
instruction sheet to explain how to properly set this up.Please give more information about the owner of the job, agent service
account details and also the configuration (like OS/SP/Language/cluster?)
In SQL2005, Activex Script subsystem is executed in separate process context
and not anymore in SQLAgent process context.
This issue you are refering was known one in non-English locale and cluster
config in our Beta releases, but has been addressed in our RTM.
I am assuming you are using RTM version of SQL2005, please confirm. If you
are using pre-RTM version, upgrade to RTM and you should see this addressed
Thanks,
Gops Dwarak
"ECS" <ecs@.netset.com> wrote in message
news:OogfHMT$FHA.1256@.TK2MSFTNGP15.phx.gbl...
> Can anyone tell me why I get this error when trying to run a job on sql
2005
> that is an activex script?
> Error creating security descriptor for shared objects (reason: No mapping
> between account names and security IDs was done). The
> step failed.
>
> I even tried credentials, proxy accounts etc. I might need to have a good
> instruction sheet to explain how to properly set this up.
>

Monday, March 19, 2012

Active Directory logins can't run schedule jobs successfully

Hi.
I have users who were recently migrated to Active
directory and ever since they haven't been able to submit
scheduled jobs successfully.
Here's the error message:
The job failed. Unable to determine if the owner (Active
Direcory group\login) of job "job name" has server access
(reason: Could not obtain information about Windows NT
group/user 'Active Direcory group\login'. [SQLSTATE 42000]
(Error 8198)).
I already added the new active directory groups to SQL
Server. I also tried giving these groups full access to
the db server and also tried to run the SQL Server Agent
service using a login in the active directory but they
still get the same error message.
A couple of workarounds here
PRB: 8198 Error Message Returned from Job Owned by Windows NT Authenticated
User
http://support.microsoft.com/default...b;en-us;241643
Also I seem to recall a fix but couldn't find it straight away, I'll have
another look
HTH
Jasper Smith (SQL Server MVP)
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"J Garcia" <anonymous@.discussions.microsoft.com> wrote in message
news:109001c43756$0c396660$3a01280a@.phx.gbl...
> Hi.
> I have users who were recently migrated to Active
> directory and ever since they haven't been able to submit
> scheduled jobs successfully.
> Here's the error message:
> The job failed. Unable to determine if the owner (Active
> Direcory group\login) of job "job name" has server access
> (reason: Could not obtain information about Windows NT
> group/user 'Active Direcory group\login'. [SQLSTATE 42000]
> (Error 8198)).
> I already added the new active directory groups to SQL
> Server. I also tried giving these groups full access to
> the db server and also tried to run the SQL Server Agent
> service using a login in the active directory but they
> still get the same error message.
>
|||Have a look at the results of the link below, in there is a fix but I'm not
sure its relavent exactly to this issue plus it would appear to be older
than SP3a so assuming you have applied that, it may not be relavent. There
is a good article on troubleshooting the error though
http://tinyurl.com/256p7
HTH
Jasper Smith (SQL Server MVP)
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"Jasper Smith" <jasper_smith9@.hotmail.com> wrote in message
news:%23RNV0R6NEHA.2480@.tk2msftngp13.phx.gbl...
> A couple of workarounds here
> PRB: 8198 Error Message Returned from Job Owned by Windows NT
Authenticated
> User
> http://support.microsoft.com/default...b;en-us;241643
> Also I seem to recall a fix but couldn't find it straight away, I'll have
> another look
> --
> HTH
> Jasper Smith (SQL Server MVP)
> I support PASS - the definitive, global
> community for SQL Server professionals -
> http://www.sqlpass.org
>
> "J Garcia" <anonymous@.discussions.microsoft.com> wrote in message
> news:109001c43756$0c396660$3a01280a@.phx.gbl...
>
|||Thanks Jasper.
I did read those articles.
Our issues w/ the 2 workarounds:
Application users submit those SQL Agent jobs thru the
application. They'd rather not use a single sql
authenticated login since they will lose their audit
trail. Plus our std authentiaction process is to use
windows security.
Our OS guys are not willing to add 'Everyone' to the Pre-
Windows 2000 Compatible Access Group due to security risks.
They did add the users' groups in the active directory but
that didn't resolve the problem.
I will add that I removed builtin\administrators from SQL
Server and am using the 'sa' account for the SQL Server
Agent connection configuration.

>--Original Message--
>Have a look at the results of the link below, in there is
a fix but I'm not
>sure its relavent exactly to this issue plus it would
appear to be older
>than SP3a so assuming you have applied that, it may not
be relavent. There
>is a good article on troubleshooting the error though
>http://tinyurl.com/256p7
>--
>HTH
>Jasper Smith (SQL Server MVP)
>I support PASS - the definitive, global
>community for SQL Server professionals -
>http://www.sqlpass.org
>
>"Jasper Smith" <jasper_smith9@.hotmail.com> wrote in
message[vbcol=seagreen]
>news:%23RNV0R6NEHA.2480@.tk2msftngp13.phx.gbl...
Windows NT[vbcol=seagreen]
>Authenticated
us;241643[vbcol=seagreen]
straight away, I'll have[vbcol=seagreen]
in message[vbcol=seagreen]
submit[vbcol=seagreen]
(Active[vbcol=seagreen]
access[vbcol=seagreen]
42000][vbcol=seagreen]
to[vbcol=seagreen]
Agent
>
>.
>

Active Directory logins can't run schedule jobs successfully

Hi.
I have users who were recently migrated to Active
directory and ever since they haven't been able to submit
scheduled jobs successfully.
Here's the error message:
The job failed. Unable to determine if the owner (Active
Direcory group\login) of job "job name" has server access
(reason: Could not obtain information about Windows NT
group/user 'Active Direcory group\login'. [SQLSTATE 42000]
(Error 8198)).
I already added the new active directory groups to SQL
Server. I also tried giving these groups full access to
the db server and also tried to run the SQL Server Agent
service using a login in the active directory but they
still get the same error message.A couple of workarounds here
PRB: 8198 Error Message Returned from Job Owned by Windows NT Authenticated
User
http://support.microsoft.com/defaul...kb;en-us;241643
Also I seem to recall a fix but couldn't find it straight away, I'll have
another look
HTH
Jasper Smith (SQL Server MVP)
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"J Garcia" <anonymous@.discussions.microsoft.com> wrote in message
news:109001c43756$0c396660$3a01280a@.phx.gbl...
> Hi.
> I have users who were recently migrated to Active
> directory and ever since they haven't been able to submit
> scheduled jobs successfully.
> Here's the error message:
> The job failed. Unable to determine if the owner (Active
> Direcory group\login) of job "job name" has server access
> (reason: Could not obtain information about Windows NT
> group/user 'Active Direcory group\login'. [SQLSTATE 42000]
> (Error 8198)).
> I already added the new active directory groups to SQL
> Server. I also tried giving these groups full access to
> the db server and also tried to run the SQL Server Agent
> service using a login in the active directory but they
> still get the same error message.
>|||Have a look at the results of the link below, in there is a fix but I'm not
sure its relavent exactly to this issue plus it would appear to be older
than SP3a so assuming you have applied that, it may not be relavent. There
is a good article on troubleshooting the error though
http://tinyurl.com/256p7
HTH
Jasper Smith (SQL Server MVP)
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"Jasper Smith" <jasper_smith9@.hotmail.com> wrote in message
news:%23RNV0R6NEHA.2480@.tk2msftngp13.phx.gbl...
> A couple of workarounds here
> PRB: 8198 Error Message Returned from Job Owned by Windows NT
Authenticated
> User
> http://support.microsoft.com/defaul...kb;en-us;241643
> Also I seem to recall a fix but couldn't find it straight away, I'll have
> another look
> --
> HTH
> Jasper Smith (SQL Server MVP)
> I support PASS - the definitive, global
> community for SQL Server professionals -
> http://www.sqlpass.org
>
> "J Garcia" <anonymous@.discussions.microsoft.com> wrote in message
> news:109001c43756$0c396660$3a01280a@.phx.gbl...
>|||Thanks Jasper.
I did read those articles.
Our issues w/ the 2 workarounds:
Application users submit those SQL Agent jobs thru the
application. They'd rather not use a single sql
authenticated login since they will lose their audit
trail. Plus our std authentiaction process is to use
windows security.
Our OS guys are not willing to add 'Everyone' to the Pre-
Windows 2000 Compatible Access Group due to security risks.
They did add the users' groups in the active directory but
that didn't resolve the problem.
I will add that I removed builtin\administrators from SQL
Server and am using the 'sa' account for the SQL Server
Agent connection configuration.

>--Original Message--
>Have a look at the results of the link below, in there is
a fix but I'm not
>sure its relavent exactly to this issue plus it would
appear to be older
>than SP3a so assuming you have applied that, it may not
be relavent. There
>is a good article on troubleshooting the error though
>http://tinyurl.com/256p7
>--
>HTH
>Jasper Smith (SQL Server MVP)
>I support PASS - the definitive, global
>community for SQL Server professionals -
>http://www.sqlpass.org
>
>"Jasper Smith" <jasper_smith9@.hotmail.com> wrote in
message
>news:%23RNV0R6NEHA.2480@.tk2msftngp13.phx.gbl...
Windows NT[vbcol=seagreen]
>Authenticated
us;241643[vbcol=seagreen]
straight away, I'll have[vbcol=seagreen]
in message[vbcol=seagreen]
submit[vbcol=seagreen]
(Active[vbcol=seagreen]
access[vbcol=seagreen]
42000][vbcol=seagreen]
to[vbcol=seagreen]
Agent[vbcol=seagreen]
>
>.
>

Active Directory has killed Replication...

Hi folks,
We've just upgraded our SQL servers to active directory. Have deleted all
of the existing jobs and replications before upgrading, as one is supposed
to do, but now when I create a new replication it just fails, saying it
can't find the distribution server specified.
The snapshot is failing at the Run agent step with "The process could not
create file '\\DIVCS-SQL1\F$\Replication\unc'. The step failed.", where
DIVCS-SQL1 is the old name of the server.
When I go to the configuration screen for the replication agent it shows the
old server name as the Distribution Server name (DIVCS-SQL1)
I assume that there is a registry item that points SQL server to the right
agent, but I don't want to start playing with it without some advice...
Thanks in advance...
Paul
Paul,
Try:
Use Master
go
Select @.@.Servername
This should return your current server name but if it
returns NULL or the oldname then try:
Use Master
go
Sp_DropServer 'Server1'
GO
Use Master
go
Sp_Addserver 'Server1', 'local'
GO
Stop and Start SQL Services
NB: You can use the @.@.SERVERNAME global variable or the SERVERPROPERTY('ServerName') function in SQL Server to find the network name of the computer running SQL Server. The ServerName property of the SERVERPROPERTY function automatically reports the chang
e in the network name of the computer when you restart the computer and the SQL Server service. The @.@.SERVERNAME global variable retains the original SQL Server computer name until the SQL Server name is manually reset.
HTH,
Paul Ibison
|||Hi,
Just tried sp_dropserver and got the following error message :
"Server: Msg 20582, Level 16, State 1, Procedure sp_MSrepl_check_server,
Line 39
Cannot drop server 'DIVCS-SQL1' because it is used as a Publisher in
replication."
I tried the 'droplogins' parameter as well, but to no avail.
Any ideas?
Cheers...P
"Paul Ibison" <Paul.Ibison@.Pygmalion.com> wrote in message
news:84A80174-EB3D-4414-9288-C84A01B6C72E@.microsoft.com...
> Paul,
> Try:
> Use Master
> go
> Select @.@.Servername
> This should return your current server name but if it
> returns NULL or the oldname then try:
> Use Master
> go
> Sp_DropServer 'Server1'
> GO
> Use Master
> go
> Sp_Addserver 'Server1', 'local'
> GO
> Stop and Start SQL Services
> NB: You can use the @.@.SERVERNAME global variable or the
SERVERPROPERTY('ServerName') function in SQL Server to find the network name
of the computer running SQL Server. The ServerName property of the
SERVERPROPERTY function automatically reports the change in the network name
of the computer when you restart the computer and the SQL Server service.
The @.@.SERVERNAME global variable retains the original SQL Server computer
name until the SQL Server name is manually reset.
> HTH,
> Paul Ibison
>
|||Paul,
am I right in saying that
Select @.@.Servername
Select SERVERPROPERTY('ServerName')
return different values?
This is the case I mentioned when you need to update the value in sysservers.
If this is so, then it means that you have set up replication on a renamed server, or you have set up replication then renamed the server. The simplest method to solve the issue is to drop the publications, disable replication, update sysservers using the
script in my previous post, then recreate the publications.
HTH,
Paul Ibison
|||Phew...Got it working.
Thanks for your help...I kind of got it...eventually.
P
"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
news:016D7C4C-5BAF-416F-87E6-0184DE7FD002@.microsoft.com...
> Paul,
> am I right in saying that
> Select @.@.Servername
> Select SERVERPROPERTY('ServerName')
> return different values?
> This is the case I mentioned when you need to update the value in
sysservers.
> If this is so, then it means that you have set up replication on a renamed
server, or you have set up replication then renamed the server. The simplest
method to solve the issue is to drop the publications, disable replication,
update sysservers using the script in my previous post, then recreate the
publications.
> HTH,
> Paul Ibison

Saturday, February 25, 2012

account change causes DTS package jobs fail

DTS packages and jobs are created as domain administrator accounts
"\\ourdomain\administrator". For some reasons (separate database
account from network account), we switched to new domain administrator
account called "\\ourdomain\sqladm" as SQL Server, service startup
account. Some DTS jobs stop running. In DTSs, server connection uses
NT default acccount. Does anyone know what is going on here? Do I have
to change the DTS owmers to "\\ourdomain\sqladm"? or I have to change
all server connection in DTS packages as SQL account connection?
Thanks in advance.You should not need to change the ownereship of the DTS package. What is
the startup account for SQL Server Agent. It controls the execution of
jobs. Log in as the SQL Server Agent startup account on the server itself
and run the DTS packages that fail form Enterprise Manager. If they fail
there too, it could be a permissions problem with the account.
Rand
This posting is provided "as is" with no warranties and confers no rights.

account change causes DTS package jobs fail

DTS packages and jobs are created as domain administrator accounts
"\\ourdomain\administrator". For some reasons (separate database
account from network account), we switched to new domain administrator
account called "\\ourdomain\sqladm" as SQL Server, service startup
account. Some DTS jobs stop running. In DTSs, server connection uses
NT default acccount. Does anyone know what is going on here? Do I have
to change the DTS owmers to "\\ourdomain\sqladm"? or I have to change
all server connection in DTS packages as SQL account connection?
Thanks in advance.
You should not need to change the ownereship of the DTS package. What is
the startup account for SQL Server Agent. It controls the execution of
jobs. Log in as the SQL Server Agent startup account on the server itself
and run the DTS packages that fail form Enterprise Manager. If they fail
there too, it could be a permissions problem with the account.
Rand
This posting is provided "as is" with no warranties and confers no rights.

account change causes DTS package jobs fail

DTS packages and jobs are created as domain administrator accounts
"\\ourdomain\administrator". For some reasons (separate database
account from network account), we switched to new domain administrator
account called "\\ourdomain\sqladm" as SQL Server, service startup
account. Some DTS jobs stop running. In DTSs, server connection uses
NT default acccount. Does anyone know what is going on here? Do I have
to change the DTS owmers to "\\ourdomain\sqladm"? or I have to change
all server connection in DTS packages as SQL account connection?
Thanks in advance.You should not need to change the ownereship of the DTS package. What is
the startup account for SQL Server Agent. It controls the execution of
jobs. Log in as the SQL Server Agent startup account on the server itself
and run the DTS packages that fail form Enterprise Manager. If they fail
there too, it could be a permissions problem with the account.
Rand
This posting is provided "as is" with no warranties and confers no rights.

Sunday, February 12, 2012

accessing remote databases thru agent jobs

We have some agents jobs which are run on schedule.
The agent jobs call stored procedures created on
local databases.
We want to move the agent jobs to a different server
(remote server). How do we set up accessing the databases
from the remote server so that none of the agent jobs need to
be changed, or with minimum change.
TIA.You would have to set up linked severs. For more information and examples,
see sp_addlinkedserver, sp_addlinkedsrvlogin, sp_serveroption in SQL Server
Books Online.
--
HTH,
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
"Data Cruncher" <dcruncher4@.netscape.net> wrote in message
news:1121880962.361317.54810@.g44g2000cwa.googlegroups.com...
> We have some agents jobs which are run on schedule.
> The agent jobs call stored procedures created on
> local databases.
> We want to move the agent jobs to a different server
> (remote server). How do we set up accessing the databases
> from the remote server so that none of the agent jobs need to
> be changed, or with minimum change.
> TIA.
>|||Narayana Vyas Kondreddi wrote:
> You would have to set up linked severs. For more information and examples,
> see sp_addlinkedserver, sp_addlinkedsrvlogin, sp_serveroption in SQL Server
> Books Online.
I too thought about the linked server option, but it seems it
still requires using a linked server name as the qualifier
for the database name.
this is the original code of the Agent job
-- Add the job steps
EXECUTE @.ReturnCode = msdb.dbo.sp_add_jobstep @.job_id = @.JobID,
@.step_id = 1, @.step_name =N'Purge', @.command = N'exec bts_CleanupDeadProcesses', @.database_name =N'BizTalkMsgBoxDb',
@.server = N'', @.database_user_name = N'', @.subsystem = N'TSQL',
@.cmdexec_success_code = 0, @.flags
= 0, @.retry_attempts = 0, @.retry_interval = 1, @.output_file_name = N'',
@.on_success_step_id = 0,
@.on_success_action = 1, @.on_fail_step_id = 0, @.on_fail_action = 2
Now how do i make the agent job refer to a remote database at the
parameter @.database_name = N'BizTalkMsgBoxDb' without qualifying it
with the linked server.
Thanks for your help.|||Narayana Vyas Kondreddi wrote:
> You would have to set up linked severs. For more information and examples,
> see sp_addlinkedserver, sp_addlinkedsrvlogin, sp_serveroption in SQL Server
That's what my initial guess was. However when I add
a linked server, in the SQL Agent Job, I still need to
qualify the database name from MyDB to LINKEDSERVER.MyDB.
is there a way to avoid it. That is, is there a way for
Agent job to know the context of server is LINKEDSERVER.
Thanks for your help.|||No. Instead you could have a constant linked server name, by adding an alias
on the server, using Client Network Utility, and by adding a linked server
using the alias name. this way you could change the server name, but still
keep the same alias name.
Anyway, makes me curious why are you movig the job to a different server?
--
HTH,
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
"Data Cruncher" <dcruncher4@.netscape.net> wrote in message
news:1121884794.983994.137000@.g43g2000cwa.googlegroups.com...
>
> Narayana Vyas Kondreddi wrote:
>> You would have to set up linked severs. For more information and
>> examples,
>> see sp_addlinkedserver, sp_addlinkedsrvlogin, sp_serveroption in SQL
>> Server
> That's what my initial guess was. However when I add
> a linked server, in the SQL Agent Job, I still need to
> qualify the database name from MyDB to LINKEDSERVER.MyDB.
> is there a way to avoid it. That is, is there a way for
> Agent job to know the context of server is LINKEDSERVER.
> Thanks for your help.
>|||Narayana Vyas Kondreddi wrote:
> No. Instead you could have a constant linked server name, by adding an alias
> on the server, using Client Network Utility, and by adding a linked server
> using the alias name. this way you could change the server name, but still
> keep the same alias name.
I am not sure how the above is relevant to my case. Please refer to
the code example I have posted in the other reply.
> Anyway, makes me curious why are you movig the job to a different server?
as you can see from the code snippet it is Biztalk jobs. We
are going to host our production server with a hosting company
and they do not support running application jobs on the
database server. So I am doing pro/con matrix to see how
much we have to change.|||Okay, you will have to make a change to the job step, if the server context
has to change.
--
HTH,
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
"Data Cruncher" <dcruncher4@.netscape.net> wrote in message
news:1121888749.038267.117940@.g49g2000cwa.googlegroups.com...
> Narayana Vyas Kondreddi wrote:
>> No. Instead you could have a constant linked server name, by adding an
>> alias
>> on the server, using Client Network Utility, and by adding a linked
>> server
>> using the alias name. this way you could change the server name, but
>> still
>> keep the same alias name.
> I am not sure how the above is relevant to my case. Please refer to
> the code example I have posted in the other reply.
>> Anyway, makes me curious why are you movig the job to a different server?
> as you can see from the code snippet it is Biztalk jobs. We
> are going to host our production server with a hosting company
> and they do not support running application jobs on the
> database server. So I am doing pro/con matrix to see how
> much we have to change.
>

accessing remote databases thru agent jobs

We have some agents jobs which are run on schedule.
The agent jobs call stored procedures created on
local databases.
We want to move the agent jobs to a different server
(remote server). How do we set up accessing the databases
from the remote server so that none of the agent jobs need to
be changed, or with minimum change.
TIA.
You would have to set up linked severs. For more information and examples,
see sp_addlinkedserver, sp_addlinkedsrvlogin, sp_serveroption in SQL Server
Books Online.
HTH,
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
"Data Cruncher" <dcruncher4@.netscape.net> wrote in message
news:1121880962.361317.54810@.g44g2000cwa.googlegro ups.com...
> We have some agents jobs which are run on schedule.
> The agent jobs call stored procedures created on
> local databases.
> We want to move the agent jobs to a different server
> (remote server). How do we set up accessing the databases
> from the remote server so that none of the agent jobs need to
> be changed, or with minimum change.
> TIA.
>
|||Narayana Vyas Kondreddi wrote:
> You would have to set up linked severs. For more information and examples,
> see sp_addlinkedserver, sp_addlinkedsrvlogin, sp_serveroption in SQL Server
> Books Online.
I too thought about the linked server option, but it seems it
still requires using a linked server name as the qualifier
for the database name.
this is the original code of the Agent job
-- Add the job steps
EXECUTE @.ReturnCode = msdb.dbo.sp_add_jobstep @.job_id = @.JobID,
@.step_id = 1, @.step_name =
N'Purge', @.command = N'exec bts_CleanupDeadProcesses', @.database_name =
N'BizTalkMsgBoxDb',
@.server = N'', @.database_user_name = N'', @.subsystem = N'TSQL',
@.cmdexec_success_code = 0, @.flags
= 0, @.retry_attempts = 0, @.retry_interval = 1, @.output_file_name = N'',
@.on_success_step_id = 0,
@.on_success_action = 1, @.on_fail_step_id = 0, @.on_fail_action = 2
Now how do i make the agent job refer to a remote database at the
parameter @.database_name = N'BizTalkMsgBoxDb' without qualifying it
with the linked server.
Thanks for your help.
|||Narayana Vyas Kondreddi wrote:
> You would have to set up linked severs. For more information and examples,
> see sp_addlinkedserver, sp_addlinkedsrvlogin, sp_serveroption in SQL Server
That's what my initial guess was. However when I add
a linked server, in the SQL Agent Job, I still need to
qualify the database name from MyDB to LINKEDSERVER.MyDB.
is there a way to avoid it. That is, is there a way for
Agent job to know the context of server is LINKEDSERVER.
Thanks for your help.
|||No. Instead you could have a constant linked server name, by adding an alias
on the server, using Client Network Utility, and by adding a linked server
using the alias name. this way you could change the server name, but still
keep the same alias name.
Anyway, makes me curious why are you movig the job to a different server?
HTH,
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
"Data Cruncher" <dcruncher4@.netscape.net> wrote in message
news:1121884794.983994.137000@.g43g2000cwa.googlegr oups.com...
>
> Narayana Vyas Kondreddi wrote:
> That's what my initial guess was. However when I add
> a linked server, in the SQL Agent Job, I still need to
> qualify the database name from MyDB to LINKEDSERVER.MyDB.
> is there a way to avoid it. That is, is there a way for
> Agent job to know the context of server is LINKEDSERVER.
> Thanks for your help.
>
|||Narayana Vyas Kondreddi wrote:
> No. Instead you could have a constant linked server name, by adding an alias
> on the server, using Client Network Utility, and by adding a linked server
> using the alias name. this way you could change the server name, but still
> keep the same alias name.
I am not sure how the above is relevant to my case. Please refer to
the code example I have posted in the other reply.

> Anyway, makes me curious why are you movig the job to a different server?
as you can see from the code snippet it is Biztalk jobs. We
are going to host our production server with a hosting company
and they do not support running application jobs on the
database server. So I am doing pro/con matrix to see how
much we have to change.
|||Okay, you will have to make a change to the job step, if the server context
has to change.
HTH,
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
"Data Cruncher" <dcruncher4@.netscape.net> wrote in message
news:1121888749.038267.117940@.g49g2000cwa.googlegr oups.com...
> Narayana Vyas Kondreddi wrote:
> I am not sure how the above is relevant to my case. Please refer to
> the code example I have posted in the other reply.
>
> as you can see from the code snippet it is Biztalk jobs. We
> are going to host our production server with a hosting company
> and they do not support running application jobs on the
> database server. So I am doing pro/con matrix to see how
> much we have to change.
>

accessing remote databases thru agent jobs

We have some agents jobs which are run on schedule.
The agent jobs call stored procedures created on
local databases.
We want to move the agent jobs to a different server
(remote server). How do we set up accessing the databases
from the remote server so that none of the agent jobs need to
be changed, or with minimum change.
TIA.You would have to set up linked severs. For more information and examples,
see sp_addlinkedserver, sp_addlinkedsrvlogin, sp_serveroption in SQL Server
Books Online.
HTH,
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
"Data Cruncher" <dcruncher4@.netscape.net> wrote in message
news:1121880962.361317.54810@.g44g2000cwa.googlegroups.com...
> We have some agents jobs which are run on schedule.
> The agent jobs call stored procedures created on
> local databases.
> We want to move the agent jobs to a different server
> (remote server). How do we set up accessing the databases
> from the remote server so that none of the agent jobs need to
> be changed, or with minimum change.
> TIA.
>|||Narayana Vyas Kondreddi wrote:
> You would have to set up linked severs. For more information and examples,
> see sp_addlinkedserver, sp_addlinkedsrvlogin, sp_serveroption in SQL Serve
r
> Books Online.
I too thought about the linked server option, but it seems it
still requires using a linked server name as the qualifier
for the database name.
this is the original code of the Agent job
-- Add the job steps
EXECUTE @.ReturnCode = msdb.dbo.sp_add_jobstep @.job_id = @.JobID,
@.step_id = 1, @.step_name =
N'Purge', @.command = N'exec bts_CleanupDeadProcesses', @.database_name =
N'BizTalkMsgBoxDb',
@.server = N'', @.database_user_name = N'', @.subsystem = N'TSQL',
@.cmdexec_success_code = 0, @.flags
= 0, @.retry_attempts = 0, @.retry_interval = 1, @.output_file_name = N'',
@.on_success_step_id = 0,
@.on_success_action = 1, @.on_fail_step_id = 0, @.on_fail_action = 2
Now how do i make the agent job refer to a remote database at the
parameter @.database_name = N'BizTalkMsgBoxDb' without qualifying it
with the linked server.
Thanks for your help.|||Narayana Vyas Kondreddi wrote:[vbcol=seagreen]
> You would have to set up linked severs. For more information and examples,
> see sp_addlinkedserver, sp_addlinkedsrvlogin, sp_serveroption in SQL Server[/vbcol
]
That's what my initial guess was. However when I add
a linked server, in the SQL Agent Job, I still need to
qualify the database name from MyDB to LINKEDSERVER.MyDB.
is there a way to avoid it. That is, is there a way for
Agent job to know the context of server is LINKEDSERVER.
Thanks for your help.|||No. Instead you could have a constant linked server name, by adding an alias
on the server, using Client Network Utility, and by adding a linked server
using the alias name. this way you could change the server name, but still
keep the same alias name.
Anyway, makes me curious why are you movig the job to a different server?
--
HTH,
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
"Data Cruncher" <dcruncher4@.netscape.net> wrote in message
news:1121884794.983994.137000@.g43g2000cwa.googlegroups.com...
>
> Narayana Vyas Kondreddi wrote:
> That's what my initial guess was. However when I add
> a linked server, in the SQL Agent Job, I still need to
> qualify the database name from MyDB to LINKEDSERVER.MyDB.
> is there a way to avoid it. That is, is there a way for
> Agent job to know the context of server is LINKEDSERVER.
> Thanks for your help.
>|||Narayana Vyas Kondreddi wrote:
> No. Instead you could have a constant linked server name, by adding an ali
as
> on the server, using Client Network Utility, and by adding a linked server
> using the alias name. this way you could change the server name, but still
> keep the same alias name.
I am not sure how the above is relevant to my case. Please refer to
the code example I have posted in the other reply.

> Anyway, makes me curious why are you movig the job to a different server?
as you can see from the code snippet it is Biztalk jobs. We
are going to host our production server with a hosting company
and they do not support running application jobs on the
database server. So I am doing pro/con matrix to see how
much we have to change.|||Okay, you will have to make a change to the job step, if the server context
has to change.
--
HTH,
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
"Data Cruncher" <dcruncher4@.netscape.net> wrote in message
news:1121888749.038267.117940@.g49g2000cwa.googlegroups.com...
> Narayana Vyas Kondreddi wrote:
> I am not sure how the above is relevant to my case. Please refer to
> the code example I have posted in the other reply.
>
> as you can see from the code snippet it is Biztalk jobs. We
> are going to host our production server with a hosting company
> and they do not support running application jobs on the
> database server. So I am doing pro/con matrix to see how
> much we have to change.
>