我有一个运行多个ssis包的作业列表。我有一个很大的列表,我想知道是否可以运行tsql到msdb并在连接字符串的步骤中获取包的信息。
答案 0 :(得分:1)
如果您的包存储在SSISDB目录中,那么您需要在SSIDB数据库上查询以获取实际的连接字符串。以下是我建议的内容,使用Rodrigo A提供的查询并调整列' Command'进一步通过使用字符串函数从中获取包名称,并将步骤ID和包名称作为输出。使用已获取的包列表并将其放在以下查询的IN子句中,并针对SSISDB运行它 -
select prj.name as 'ProjectName'
,op.object_name as 'SSISPackageName'
,op.parameter_name as 'ParmaterName'
,op.design_default_value as 'ConnectionString'
from catalog.object_parameters op
join catalog.projects prj
on op.project_id = prj.project_id
where op.parameter_name like '%ConnectionString%'
and op.object_name in (
--put the package name list here
);
然后,您可以加入结果集,以获取该包中的步骤Id,PackageName和连接字符串。
答案 1 :(得分:1)
超级老线程,但下面的代码稍作修改,更有用,因为它显示了包级别的详细信息。
select
prj.name as 'ProjectName'
,pa.name as 'SSISPackageName'
,op.parameter_name as 'ParmaterName'
,op.design_default_value as 'ConnectionString'
from
catalog.object_parameters op
join catalog.projects prj
on op.project_id = prj.project_id
join [catalog].[packages] pa
on pa.project_id = prj.project_id
where op.parameter_name like '%ConnectionString%'
答案 2 :(得分:0)
在要检查的服务器上运行此查询:
SELECT [sJSTP].[step_id], Name, sJSTP.Command FROM [msdb].[dbo].[sysjobs] [sJOB]
LEFT JOIN [msdb].[dbo].[sysjobsteps] AS [sJSTP]
ON [sJOB].[job_id] = [sJSTP].[job_id]
AND [sJOB].[start_step_id] = [sJSTP].[step_id]
ORDER BY Name, step_id
干杯!