This article mainly introduces the analysis of the process of obtaining the returned data from the stored procedure in sql. The sample code in the article is very detailed and has a certain reference value for everyone's study or work. Friends in need can refer to it. After executing the storage, the data of the stored procedure execution is obtained and used as a secondary function for other applications. In fact, the code can be said to be similar to the call, the specific operations are as follows: Create a stored procedure: use [library name] go set ansi_null on GO SET QUOTED_IDENTIFIER ON GO CREATE PROCEDURE DBO.P_TEST ( @RBACK VARCHAR(20) OUT -- here out means what needs to be returned) AS BEGIN TRY SET @RBACK= (SELECT 2+2) END TRY The above script returns a result of 2+2 equals 4. How to call it externally, or in other stored procedure scripts, is as follows: declare @RBACK VARCHAR(20) EXEC library name.dbo.P_TEST @REBACK OUT SELECT @REBACK Execution returns 4, so it can be used more flexibly. It will be much more convenient in the later work. The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: Windows Server 2019 IIS10.0+PHP(FastCGI)+MySQL Environment Construction Tutorial
>>: A complete record of the process of building mobile applications using Vue Native
I always feel that designers are the most sensiti...
Preface Recently connected to mysql /usr/local/my...
Table of contents Vue.js 1. Register global guard...
Preface I have been summarizing my front-end know...
This article shares the specific code for JavaScr...
Regarding the nginx panic problem, we first need ...
Using abbreviations can help reduce the size of yo...
This is because the database server is set to aut...
mysql returns Boolean type In the first case, ret...
Countdown function needs to be implemented in man...
This article example shares the specific code for...
As we all know, there are two types of images in c...
Detailed explanation of Linux vi command The vi e...
Because colleagues in the company need Nginx log ...
Table of contents posgresql backup/restore mysql ...