- CREATE TRIGGER [TRIGGER NAME] ON [dbo].[USERDATA]
- FOR UPDATE
- AS
- Begin
- if update([exp])
- begin
- declare @oldExp int
- declare @newExp int
- declare @strUserId char(21)
- select @strUserId = strUserId, @oldExp = [exp] from deleted
- select @newExp = [exp] from inserted
- if( @newExp < 0 )
- begin
- declare @exp70 int
- select @exp70 = exp from LEVEL_UP where [level]=70
- update userData
- set exp = cast((@oldExp - @exp70*0.05) as int)
- where strUserId = @strUserId
- end
- end
- End
复制代码 限制70级的存储,(这个不可以吗?别人很早就发出来了) |