点击这里给我发消息

存储过程proc

//创建

Create  PROCEDURE [dbo].[FindUserID]
 -- Add the parameters for the stored procedure here
 @sRegName varchar(50),
 @iID int output
 
AS
BEGIN
 -- SET NOCOUNT ON added to prevent extra result sets from
 -- interfering with SELECT statements.
 SET NOCOUNT ON;

    -- Insert statements for procedure here
 select @iID = iID  from tRegUser  where sRegName = @sRegName

END

//执行

declare @n int
exec FindUserID 'xiao',@n output
print(@n)

posted @ 2009-02-28 22:50 lijunzaizi 阅读(68) 评论(0) 编辑 收藏