存储过程 output 输出参数 可以是一个字符串
return num --只能是整数
CREATE PROCEDURE ch
@ch VARCHAR(55) OUTPUT,
@PING VARCHAR(45) OUTPUT
AS
SELECT @ch='ffgfgfg',@PING='chenssksksk'
--调用
DECLARE @chs VARCHAR(55),@pins VARCHAR(45)
EXECUTE ch @chs OUTPUT,@pins OUTPUT
PRINT @chs
PRINT @pins
=============
CREATE PROCEDURE PIN
AS
RETURN 1
DECLARE @NUM INT
SET EXECUTE @NUM=PIN
PRINT @NUM
==================
CREATE FUNCTION jian()
RETURNS VARCHAR(500)
AS
BEGIN
DECLARE @ch VARCHAR(50)
SET @ch='dkdkkddk'
RETURN @ch
END
SELECT dbo.jian()文章源自很文博客https://www.hinvn.com/很文博客-https://www.hinvn.com/52258.html
文章源自很文博客https://www.hinvn.com/很文博客-https://www.hinvn.com/52258.html
评论