Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
804 views
in Technique[技术] by (71.8m points)

sql-server - 使用输出参数执行存储过程?(Execute stored procedure with an Output parameter?)

I have a stored procedure that I am trying to test.

(我有一个要测试的存储过程。)

I am trying to test it through SQL Management Studio.

(我正在尝试通过SQL Management Studio进行测试。)

In order to run this test I enter ...

(为了运行此测试,我输入...)

exec my_stored_procedure 'param1Value', 'param2Value'

The final parameter is an output parameter .

(最终参数是output parameter 。)

However, I do not know how to test a stored procedure with output parameters.

(但是,我不知道如何使用输出参数测试存储过程。)

How do I run a stored procedure with an output parameter?

(如何运行带有输出参数的存储过程?)

  ask by user70192 translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The easy way is to right-click on the procedure in Sql Server Management Studio (SSMS),

(最简单的方法是right-clickprocedureSQL Server Management Studio中 (SSMS))

select execute stored procedure...

(选择execute stored procedure...)

and add values for the input parameters as prompted.

(并根据提示为输入参数添加值。)

SSMS will then generate the code to run the proc in a new query window, and execute it for you.

(然后, SSMS将生成代码以在新的查询窗口中运行proc并为您执行。)

You can study the generated code to see how it is done.

(您可以研究生成的代码以了解其完成方式。)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...