February 23, 2011 at 3:52 am
Created s - proc for data insertion with 4 parameters to be passed
create procedure insterdata
@firstname varchar(100),
@middlename varchar(100),
@lastname varchar(100),
@contactid int
as
insert into dbo.ContactInfo(firstname,middlename,lastname,contactid)
values(@firstname,@middlename,@lastname,@contactid)
i want to execute this s proc in Execute SQL Task.
can any body help me how to execute this insert proc from Execute SQL task.
February 24, 2011 at 4:16 am
The code inside the Execute SQL Task would be as follows:
DECLARE @firstname VARCHAR(100), @middlename VARCHAR(100), @lastname VARCHAR(100), @contactid INT;
SET @firstname= ?; -- 0
SET @middlename= ?; -- 1
SET @lastname= ?; -- 2
SET @contactid= ?; -- 3
EXEC dbo.insertdata @firstname, @middlename, @lastname, @contactid
In the parameter mapping, you specify the SSIS variables as input with the appropriate data types. Make sure you give them the correct ordinal position, as they will be mapped agains the question marks.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
February 25, 2011 at 5:40 am
Just curious why you wouldn't simply specify that the call is a stored procedure and then add the input parameters.
Enter the scheme.name of the procedure and specify Is Stored Procede = true. Then use the input parm names @parm and map to variable in the parameters section.
February 25, 2011 at 6:22 am
Tom Van Harpen (2/25/2011)
Just curious why you wouldn't simply specify that the call is a stored procedure and then add the input parameters.Enter the scheme.name of the procedure and specify Is Stored Procede = true. Then use the input parm names @parm and map to variable in the parameters section.
I didn't know that was possible. Until now 😀
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
February 25, 2011 at 12:33 pm
Thanks a lot as simple as that. really appreciate
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply