Script step in a job

  • Hi,

    I am trying to replace the commands of step2 with my new command in a sql server agent job by creating a script.

    I cannot see a script to new query window option for a step in sql server agent.

    Any help is really appreciated.

    Thanks,

    Deepthy

  • I'm not clear on what you're trying to do.

    Why do you need a new window in order to put a T-SQL script into a job?

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • This is how I update a job step command via scripting:

    EXEC msdb.dbo.sp_update_jobstep

    @job_name = N'Job Name',

    @step_id = 2,

    @command = N'new command' ;

    This is how I version a job step change in TFS and push the same change to all environments.

    Reference: http://msdn.microsoft.com/en-us/library/ms189827.aspx

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • thanks that helped

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply