MSSQL output使用
发布时间:2016-12-29 来源:查字典编辑
摘要:returnnum--只能是整数CREATEPROCEDUREch@chVARCHAR(55)OUTPUT,@PINGVARCHAR(45)...
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()