当前位置: 数据库>mysql
MSSQL output使用
来源: 互联网 发布时间:2014-09-06
本文导语: 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 ...
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()