简体   繁体   English

如何在SQL Server 2005中以文本形式查看作业

[英]how to view the job in text in sql server 2005

Ex: for store procedure we use sp_helptext .is there any keyword for viewing jobs in text in sql server 2005 例如:对于存储过程,我们使用sp_helptext。在SQL Server 2005中是否存在用于查看文本中的作业的任何关键字

regards kumar 问候库马尔

You can query the various tables in msdb database to get the list of the jobs and their details. 您可以查询msdb数据库中的各种表,以获取作业列表及其详细信息。

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. 对于类似这样的东西,我知道如何在Management Studio中执行某项操作,但是不确定如何通过代码来执行此操作,有时我会启动探查器跟踪,然后在Management Studio中执行操作以查看正在执行的操作。 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 如果您看一下它的定义,似乎可以使用msdb.dbo.sysjobsteps

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM