Re: Run job from DTS package

From: Allan Mitchell (allan_at_no-spam.sqldts.com)
Date: 12/02/04


Date: Thu, 2 Dec 2004 20:26:23 -0000

Can't do that. You do not get the option to "Run As". If you schedule your
DTS package then you can have the Account under which it runs have perms to
do the job running.

How do you propose to know that the backup job you have selected comes from
your maint plan? I can backup databases without using main plans
Which maint plan? You may have one for logs and one for some databases,
others for other databases.

In msdb you have

dbo.sysdbmaintplan_jobs which will give you the Guids of the Job and the
Plan
dbo.sysdbmaintplans will give you name of the plans matched on GUIDs
dbo.sysdbmaintplan_databases will give you the name(s) of the databases upon
which your plan operates.

At no point do I see an action type though.

You still need to know the name of the plan though.

-- 
-- 
Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.konesans.com - Consultancy from the people who know
"Sam" <Sam@discussions.microsoft.com> wrote in message 
news:70754FB4-F03E-4614-97B4-BA0EDA0B58F4@microsoft.com...
>
> Yes I could hard code the jobname, but I was looking for something a 
> little
> more dynamic that would allow me to more easily deploy the package to
> multiple servers & hopefully allow me to specify the UserID/Passwword to 
> run
> the job.
>
> Sam
> "Allan Mitchell" wrote:
>
>> Is there some reason you would need to dunamically dtermine the job name?
>> Can you not just hard code it ++ you cannot just start any old job, you 
>> have
>> to have permissions.
>>
>> From BOL
>>
>> Execute permissions default to the public role in the msdb database. A 
>> user
>> who can execute this procedure and is a member of the sysadmin fixed role
>> can start any job. A user who is not a member of the sysadmin role can 
>> use
>> sp_start_job to start only the jobs he/she owns.
>>
>>
>>
>> -- 
>> -- 
>>
>> Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
>> www.SQLDTS.com - The site for all your DTS needs.
>> www.konesans.com - Consultancy from the people who know
>>
>>
>> "Sam" <Sam@discussions.microsoft.com> wrote in message
>> news:2E7D8BB6-2DEB-4F1D-B9AC-DE3CBC5EB2D2@microsoft.com...
>> > I'm looking for a simple way to run a Maintenance Plan's backup job 
>> > from a
>> > DTS package. I know I can use the sp_Start_Job, but this requires a
>> > jobname
>> > or jobID. To get those I would need to parse through the output from a
>> > sp_Help-Job & look for 'Backup' & 'databasename'.
>> >
>> > Also, I want to use the backup job from my Maintenance Plan, so that if 
>> > I
>> > or
>> > another DBA needs to perform a recovery, all of the backup files are in
>> > the
>> > same location with the sme naming conventions.
>> >
>> > Thanks
>>
>>
>> 


Relevant Pages

  • Re: Backup job reported as failed
    ... databases in MS SQL Server 2005. ... In the "Maintenance Plan" node of the log viewer: ... Every entry has a red X next to it. ...
    (microsoft.public.sqlserver.tools)
  • Re: sqlmaint.exe hangs
    ... We have multiple maintenance plans. ... One such plan for database txn log backup, takes txn log backup on each ... When i check the sysdbmaintplan_history tables it shows all databases txn ...
    (microsoft.public.sqlserver.tools)
  • Re: backup error - single user mode needed?
    ... Databse Manintenance Plan on System Databases faile on Intergrity ... in the single user mode in order to execute CkDBRepair. ... The repair step fails to run and the job reports a failure.... ...
    (microsoft.public.sqlserver.msde)
  • Re: Backup job reported as failed
    ... Perhaps you can find some details if you specify a report file for the plan and investigate that file? ... Tibor Karaszi, SQL Server MVP ... databases in MS SQL Server 2005. ... Deletes old backup files ...
    (microsoft.public.sqlserver.tools)