Call parametized SP using Execute SQL Task

  • Hi ,

    I have created a store procedure like below

    ALTER Procedure [dbo].[Call_All_Incremental]

    @Filename varchar(100)

    as

    begin

    If @Filename='CCNVZ'

    exec ETL_STAGE_ARCHIVE_CCNVZ

    Else If @Filename='CCSMS'

    exec ETL_STAGE_ARCHIVE_CCSMS

    Else If @Filename='CCTFB'

    exec ETL_STAGE_ARCHIVE_CCTFB

    End

    when I am executing SP with EXEC dbo.Call_All_Incremental ? command .

    and in parameter I have added a varible @filename I am getting error like

    [Execute SQL Task] Error: Executing the query "EXEC dbo.Call_All_Incremental ?" failed with the following error: "No value given for one or more required parameters.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.

    sdsd

    ResultSet type is None.

    when I am manually passing the value of variable like EXEC dbo.Call_All_Incremental 'FDOOR' its running properly

    suggeste me how can I run sucessful using Execute sal task

  • Do you have a parameter mapping of parameter name "0" to variable @filename?

    Russel Loski, MCSE Business Intelligence, Data Platform

  • Check your SQL task configuration. In the parameter mapping window please make sure you have below values:

    Variable Name: @filename

    Direction: Input

    Data Type: VARCHAR

    Parameter Name: 0

    Parameter Size: -1

    ____________________________________________________________

    AP

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply