006_SSIS execute sql task 调用存储过程

Posted renzy194

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了006_SSIS execute sql task 调用存储过程相关的知识,希望对你有一定的参考价值。

1.首先在SqlServer中创建存储过程:

if OBJECT_ID(\'usp_t013_inset_process_log\') is not null
drop procedure usp_t013_inset_process_log
go
	create procedure usp_t013_inset_process_log
	@execution_id varchar(50),
	@package_name varchar(50),
	@machine_name varchar(50),
	@id int output
	as
	begin
		insert into T013_PROCESS_LOG values(@execution_id,@package_name,@machine_name,GETDATE(),null,1);
		select @id = @@IDENTITY;
	end
	return 1;
go

2.在sql task 中输以下语句用于sql调用

declare @id_ int
declare @return_value int 
execute ? = usp_t013_inset_process_log
@execution_id = ?,
@package_name = ?,
@machine_name = ?,
@id = ? output

3.创建两个参数用于获得返回值与输出值,在参数映射部分配置好对应的映射,注意参数名称的值大小与sql语句中的?依次对应

以上是关于006_SSIS execute sql task 调用存储过程的主要内容,如果未能解决你的问题,请参考以下文章