Stored Procedure, when to use Output parameter vs Return variable

前端 未结 7 1472
不思量自难忘°
不思量自难忘° 2020-12-28 12:54

When would you use an output parameter vs a return variable, or vice versa? In the following simple example, I can achieve the same thing using either one.

Using out

7条回答
  •  梦毁少年i
    2020-12-28 13:22

    I will answer this question in different ways:

    If you would like to return one value you have both the options. But if you would like to return multiple values you only need to stick with output parameters.

    Second Scenario: In C# you have the control of type if you are using output parameters.

    Third scenario: Function vs. Procedure select the one suiting to your needs.

    Hope this helps

提交回复
热议问题