dbTalk Databases Forums  

How do i set Job.JobType = Local?

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss How do i set Job.JobType = Local? in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Eigh
 
Posts: n/a

Default How do i set Job.JobType = Local? - 05-02-2008 , 01:00 PM






I'm trying to create a scheduled job on SQL Server Agent using SMO with
VB.NET 2.0.

Here's a short code snippet:

Dim theServer As New Server(strServerFQDN)
Dim newJob As New Agent.Job(theServer.JobServer, strNewJobName)
newJob.Create()

'Create job steps (not going to reproduce that code here)
'Create job schedule (not going to reproduce that code here)

After I've created the Job, its marked as "Target multiple servers" in the
Job Properties dialog in SSMS. This behavior appears to be the default.

Instead, I want to set the JobType to Local, but that attribute of the Job
class is ReadOnly.

Can anyone point me in the right direction as to how I can set JobType to
Local? I've already googled this and cannot find any results.

Thanks for anyone who can give me some insight.

Reply With Quote
  #2  
Old   
Eigh
 
Posts: n/a

Default RE: How do i set Job.JobType = Local? - 05-02-2008 , 03:09 PM






For anyone else who encounters this issue, I was able to fix it by adding
this line of code:

newJob.APplyToTargetServer("(local)")



"Eigh" wrote:

Quote:
I'm trying to create a scheduled job on SQL Server Agent using SMO with
VB.NET 2.0.

Here's a short code snippet:

Dim theServer As New Server(strServerFQDN)
Dim newJob As New Agent.Job(theServer.JobServer, strNewJobName)
newJob.Create()

'Create job steps (not going to reproduce that code here)
'Create job schedule (not going to reproduce that code here)

After I've created the Job, its marked as "Target multiple servers" in the
Job Properties dialog in SSMS. This behavior appears to be the default.

Instead, I want to set the JobType to Local, but that attribute of the Job
class is ReadOnly.

Can anyone point me in the right direction as to how I can set JobType to
Local? I've already googled this and cannot find any results.

Thanks for anyone who can give me some insight.

Reply With Quote
  #3  
Old   
Eigh
 
Posts: n/a

Default RE: How do i set Job.JobType = Local? - 05-02-2008 , 03:09 PM



For anyone else who encounters this issue, I was able to fix it by adding
this line of code:

newJob.APplyToTargetServer("(local)")



"Eigh" wrote:

Quote:
I'm trying to create a scheduled job on SQL Server Agent using SMO with
VB.NET 2.0.

Here's a short code snippet:

Dim theServer As New Server(strServerFQDN)
Dim newJob As New Agent.Job(theServer.JobServer, strNewJobName)
newJob.Create()

'Create job steps (not going to reproduce that code here)
'Create job schedule (not going to reproduce that code here)

After I've created the Job, its marked as "Target multiple servers" in the
Job Properties dialog in SSMS. This behavior appears to be the default.

Instead, I want to set the JobType to Local, but that attribute of the Job
class is ReadOnly.

Can anyone point me in the right direction as to how I can set JobType to
Local? I've already googled this and cannot find any results.

Thanks for anyone who can give me some insight.

Reply With Quote
  #4  
Old   
Eigh
 
Posts: n/a

Default RE: How do i set Job.JobType = Local? - 05-02-2008 , 03:09 PM



For anyone else who encounters this issue, I was able to fix it by adding
this line of code:

newJob.APplyToTargetServer("(local)")



"Eigh" wrote:

Quote:
I'm trying to create a scheduled job on SQL Server Agent using SMO with
VB.NET 2.0.

Here's a short code snippet:

Dim theServer As New Server(strServerFQDN)
Dim newJob As New Agent.Job(theServer.JobServer, strNewJobName)
newJob.Create()

'Create job steps (not going to reproduce that code here)
'Create job schedule (not going to reproduce that code here)

After I've created the Job, its marked as "Target multiple servers" in the
Job Properties dialog in SSMS. This behavior appears to be the default.

Instead, I want to set the JobType to Local, but that attribute of the Job
class is ReadOnly.

Can anyone point me in the right direction as to how I can set JobType to
Local? I've already googled this and cannot find any results.

Thanks for anyone who can give me some insight.

Reply With Quote
  #5  
Old   
Eigh
 
Posts: n/a

Default RE: How do i set Job.JobType = Local? - 05-02-2008 , 03:09 PM



For anyone else who encounters this issue, I was able to fix it by adding
this line of code:

newJob.APplyToTargetServer("(local)")



"Eigh" wrote:

Quote:
I'm trying to create a scheduled job on SQL Server Agent using SMO with
VB.NET 2.0.

Here's a short code snippet:

Dim theServer As New Server(strServerFQDN)
Dim newJob As New Agent.Job(theServer.JobServer, strNewJobName)
newJob.Create()

'Create job steps (not going to reproduce that code here)
'Create job schedule (not going to reproduce that code here)

After I've created the Job, its marked as "Target multiple servers" in the
Job Properties dialog in SSMS. This behavior appears to be the default.

Instead, I want to set the JobType to Local, but that attribute of the Job
class is ReadOnly.

Can anyone point me in the right direction as to how I can set JobType to
Local? I've already googled this and cannot find any results.

Thanks for anyone who can give me some insight.

Reply With Quote
  #6  
Old   
Eigh
 
Posts: n/a

Default RE: How do i set Job.JobType = Local? - 05-02-2008 , 03:09 PM



For anyone else who encounters this issue, I was able to fix it by adding
this line of code:

newJob.APplyToTargetServer("(local)")



"Eigh" wrote:

Quote:
I'm trying to create a scheduled job on SQL Server Agent using SMO with
VB.NET 2.0.

Here's a short code snippet:

Dim theServer As New Server(strServerFQDN)
Dim newJob As New Agent.Job(theServer.JobServer, strNewJobName)
newJob.Create()

'Create job steps (not going to reproduce that code here)
'Create job schedule (not going to reproduce that code here)

After I've created the Job, its marked as "Target multiple servers" in the
Job Properties dialog in SSMS. This behavior appears to be the default.

Instead, I want to set the JobType to Local, but that attribute of the Job
class is ReadOnly.

Can anyone point me in the right direction as to how I can set JobType to
Local? I've already googled this and cannot find any results.

Thanks for anyone who can give me some insight.

Reply With Quote
  #7  
Old   
Eigh
 
Posts: n/a

Default RE: How do i set Job.JobType = Local? - 05-02-2008 , 03:09 PM



For anyone else who encounters this issue, I was able to fix it by adding
this line of code:

newJob.APplyToTargetServer("(local)")



"Eigh" wrote:

Quote:
I'm trying to create a scheduled job on SQL Server Agent using SMO with
VB.NET 2.0.

Here's a short code snippet:

Dim theServer As New Server(strServerFQDN)
Dim newJob As New Agent.Job(theServer.JobServer, strNewJobName)
newJob.Create()

'Create job steps (not going to reproduce that code here)
'Create job schedule (not going to reproduce that code here)

After I've created the Job, its marked as "Target multiple servers" in the
Job Properties dialog in SSMS. This behavior appears to be the default.

Instead, I want to set the JobType to Local, but that attribute of the Job
class is ReadOnly.

Can anyone point me in the right direction as to how I can set JobType to
Local? I've already googled this and cannot find any results.

Thanks for anyone who can give me some insight.

Reply With Quote
  #8  
Old   
Eigh
 
Posts: n/a

Default RE: How do i set Job.JobType = Local? - 05-02-2008 , 03:09 PM



For anyone else who encounters this issue, I was able to fix it by adding
this line of code:

newJob.APplyToTargetServer("(local)")



"Eigh" wrote:

Quote:
I'm trying to create a scheduled job on SQL Server Agent using SMO with
VB.NET 2.0.

Here's a short code snippet:

Dim theServer As New Server(strServerFQDN)
Dim newJob As New Agent.Job(theServer.JobServer, strNewJobName)
newJob.Create()

'Create job steps (not going to reproduce that code here)
'Create job schedule (not going to reproduce that code here)

After I've created the Job, its marked as "Target multiple servers" in the
Job Properties dialog in SSMS. This behavior appears to be the default.

Instead, I want to set the JobType to Local, but that attribute of the Job
class is ReadOnly.

Can anyone point me in the right direction as to how I can set JobType to
Local? I've already googled this and cannot find any results.

Thanks for anyone who can give me some insight.

Reply With Quote
  #9  
Old   
Eigh
 
Posts: n/a

Default RE: How do i set Job.JobType = Local? - 05-02-2008 , 03:09 PM



For anyone else who encounters this issue, I was able to fix it by adding
this line of code:

newJob.APplyToTargetServer("(local)")



"Eigh" wrote:

Quote:
I'm trying to create a scheduled job on SQL Server Agent using SMO with
VB.NET 2.0.

Here's a short code snippet:

Dim theServer As New Server(strServerFQDN)
Dim newJob As New Agent.Job(theServer.JobServer, strNewJobName)
newJob.Create()

'Create job steps (not going to reproduce that code here)
'Create job schedule (not going to reproduce that code here)

After I've created the Job, its marked as "Target multiple servers" in the
Job Properties dialog in SSMS. This behavior appears to be the default.

Instead, I want to set the JobType to Local, but that attribute of the Job
class is ReadOnly.

Can anyone point me in the right direction as to how I can set JobType to
Local? I've already googled this and cannot find any results.

Thanks for anyone who can give me some insight.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.