日期:2014-05-18 浏览次数:20516 次
ALTER PROC [dbo].[addUser] ( @qqOpenID CHAR(32), @userName NVARCHAR(30), @qqImg VARCHAR(150), @rankType TINYINT, @sex TINYINT, @insertGuidKey CHAR(36), @wbName VARCHAR(50), @id INT OUT, @introduction NVARCHAR(500) ) AS SELECT @id=ID FROM Users WHERE qqOpenID=@qqOpenID IF(@@ROWCOUNT>0) BEGIN UPDATE Users SET guidKey=@insertGuidKey,wbName=@wbName WHERE ID=@id RETURN 65; END ELSE BEGIN INSERT Users(qqOpenID,userName,qqImg,rankType,sex,guidKey,wbName,typeid,introduction) VALUES(@qqOpenID,@userName,@qqImg,@rankType,@sex,@insertGuidKey,@wbName,1,@introduction) Select @id=SCOPE_IDENTITY() RETURN 66; END