how to view the job in text in sql server 2005
Ex: for store procedure we use 开发者_如何学Pythonsp_helptext .is there any keyword for viewing jobs in text in sql server 2005
regards kumar
You can query the various tables in msdb database to get the list of the jobs and their details.
For example
select * from msbdb.dbo.sysjobs
will give you the list of all the jobs in the server while
select * from msdb.dbo.sysjobactivity
will give you the job activity details.
For stuff like this where I know how to do something in Management Studio but aren't sure of the way to do it by code I sometimes start a profiler trace then perform the action in Management Studio to see what that is doing. Doing that on my system indicates that the following might help.
exec msdb.dbo.sp_help_jobstep @job_name = 'Your job name'
If you look at the definition of that it seems to use msdb.dbo.sysjobsteps
精彩评论