006_SSIS execute sql task to call a stored procedure

1. Start by creating a stored procedure in SqlServer in:

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. Enter the following statement in sql task for sql call

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

3. Create two parameters used to obtain the return value and output value, configured the corresponding mapping parameter mapping section, note the size and value of the parameter name sql statement in? In turn corresponds to

Guess you like

Origin www.cnblogs.com/renzy194/p/12045496.html