日期:2014-05-18 浏览次数:20618 次
ALTER PROCEDURE [dbo].[getUserNamebb]
    @UserName varchar(100),
    @paww varchar(100),
    @biaoshu varchar(100)
as
begin
    declare @cishu int,@mon int,@uuid int,@StartTime datetime
    set @uuid=0;
    set @StartTime =(select getdate())
    select top 1 pe_pwdd,pe_sex,pe_nini,diqu1,diqu2,pe_UserId,addtime,pe_zhuye,pe_cishu
    from dbo.[useruser1]  
    where pe_email=@UserName and pe_pwdd=@paww
    if @@rowcount>0
    begin
        select top 1 @uuid=pe_UserId
          from dbo.[useruser1]  
          where pe_email=@UserName and pe_pwdd=@paww
          
        update useruser1 set pe_cishu=pe_cishu+1,zuihoutime=@StartTime where pe_userid=@uuid
        
        declare @strSql nvarchar(2048)
        set @strSql = 'Select pe_jibie,pe_zeou,pe_Photo,pe_nianji,pe_zhuye,pe_zhaopian From ' + @biaoshu + ' Where pe_UserId=@uuid'
        execute sp_executesql @strSql,N'@uuid int',@uuid
    end   
    else
    return 1
end
------解决方案--------------------