Code demonstration of input and output parameters in stored procedures in SQL Server

From , 3 Years ago, written in SQL, viewed 140 times.
URL https://pastebin.vip/view/f26ecc6e
  1. -- ===================【创建存储过程】=====================
  2.  
  3. USE [Message]
  4. GO
  5. /****** Object:  StoredProcedure [dbo].[读取外部数据库查询]    Script Date: 10/24/2012 05:39:16 ******/
  6. SET ANSI_NULLS ON
  7. GO
  8. SET QUOTED_IDENTIFIER ON
  9. GO
  10. -- =============================================  \\ Working没有变1,错误码没有测试,计划时间测试,企业名称
  11.  
  12. CREATE PROCEDURE [dbo].[数据库查询]
  13.         @SmsContent VARCHAR(20)='1231',   -- 输入参数
  14.         @bj1 INT OUT -- 输入出参数
  15.          
  16. AS
  17. BEGIN
  18.              
  19.     SELECT @bj1=COUNT(Id) FROM sss
  20.    
  21. END
  22.  
  23.  
  24. -- ===============【调用】==================
  25.  
  26. USE [Message]
  27.  
  28. DECLARE @return_value INT
  29.  
  30. EXEC    [dbo].[数据库查询] '1231',@return_value output
  31.  
  32. SELECT  @return_value
  33. //SQL/5542

Reply to "Code demonstration of input and output parameters in stored procedures in SQL Server"

Here you can reply to the paste above

captcha

https://burned.cc - Burn After Reading Website