locked
WCF-SQL Stored Procedure Issue RRS feed

  • Question

  • Hi all,

    Trying to invoke Stored Procedure from receive location, But returning error

    "expects parameter 'TStamp', which was not supplied."

    ALTER

    PROCEDUREUpdate

     

    @TStamp  DATETIMEOUTPUT

    AS

    BEGIN


    SETNOCOUNTON;


    If (SelectCount(*)FromTimeStamp)=0

    Begin


    InsertIntoTimeStamp(Run)


    Values (getdate())


    Set@TStamp=(SelectRun From TimeStamp)


    End

    Else


    Begin


    Set@TStamp =(SelectRun FromTimeStamp)


    Update TimeStamp SetRun =getdate()


    End



    END

    Any Suggestion Please

    Tuesday, May 24, 2016 10:32 PM

Answers

All replies

  • Hi,

    As the message suggests, this error occurs when executing a stored procedure that expects a parameter that was not supplied and the parameter does not have a default value specified during creation. If the parameter has a default value assigned, this error message will not occur for that particular parameter.

    Accordingly change your SP.

    Refer: http://www.sql-server-helper.com/error-messages/msg-201.aspx

    Specifying a Parameter Default Value


    Rachit Sikroria (Microsoft Azure MVP)

    Friday, May 27, 2016 6:52 AM
    Moderator
  • Hi,

    It looks output parameter is not returning value and WCF-SQL is expecting some value in return, I would suggest to add some default value to output parameter in your stored procedure.

    i.e.

    @TStamp  DATETIME = '0001-01-01 00:00:00.000' OUTPUT AS

    Hope this Helps!!

    Please mark this as Answered if your query get Reply.

     
    • Proposed as answer by vikas.a.mehta Friday, May 27, 2016 7:11 AM
    Friday, May 27, 2016 7:11 AM