Can I have an optional OUTPUT parameter in a stored procedure?

后端 未结 5 915
花落未央
花落未央 2020-12-10 10:07

I have a stored procedure that has a bunch of input and output parameters because it is Inserting values to multiple tables. In some cases the stored proc only inserts to a

5条回答
  •  借酒劲吻你
    2020-12-10 10:34

    Looks like I can just add a default value to the OUTPUT parameter such as:

    @AddressId int = -1 Output
    

    Seems like its poor in terms of readability since AddressId is intended strictly as an OUTPUT variable. But it works. Please let me know if you have a better solution.

提交回复
热议问题