日期:2014-05-18 浏览次数:20431 次
create procedure Returnvalue as declare @int int set @int = 1232432332 return @int go declare @Getint int exec @Getint=Returnvalue print @Getint
------解决方案--------------------
UP
------解决方案--------------------
建议输出参数
------解决方案--------------------
create proc pTest ( --其它参数, @weight int output, @quantity int output ) as --1 select * from 表 where ... --2,3 select @weight=sum(重量),@quantity=sum(件数) from 表 where ... go
------解决方案--------------------
100分. 帮你顶一下,hehe
------解决方案--------------------
楼上的E文了得
PFPF :_>
------解决方案--------------------
Using OUTPUT variables (please use AdventureWorks sample database for checkup):
CREATE PROCEDURE dbo.GetCountByLastName ( @LastName NVARCHAR(50), @LastNameCount INT OUTPUT ) AS SELECT @LastNameCount = COUNT(*) FROM Person.Contact WHERE LastName = @LastName