首先保证你的两个存储过程是这样的
1、MyGSFun_SetExtChrData
CREATE proc MyGSFun_SetExtChrData
@AccountID varchar(10),
@Name varchar(10),
@FQBZ int,
@FQCount int,
@FQName varchar(10),
@Lores int,
@RTN varchar(100) OUTPUT
as
set nocount on
declare @ec int
,@ll int
,@jf int
,@jfbl int
set @jfbl=2 --设置积分兑换比例 1/X
set @ec=0
begin tran
select @ll=LastLores from extchrdata where accountid=@accountid and name=@name
--转换为积分
if @ll is null
set @jf=cast(@Lores/@jfbl as int)
else
set @jf=cast((@Lores-@ll)/@jfbl as int)
update ExtIdData set HaveCents=HaveCents+@jf where AccountID=@AccountID
--set @ec = @ec | @@error --不管积分更新是否成功都应更新角色数据
if @ll is not null begin
update extchrdata set FQName=@FQName,FQBZ=@FQBZ,FQCount=@FQCount
,Lores=@lores,LastLores=LastLores+@jf*@jfbl
where accountid=@accountid and name=@name
set @ec = @ec | @@error
end else begin
insert into extchrdata (AccountID,Name,FQBZ,FQCount,FQName,Lores,LastLores)
values (@AccountID,@Name,@FQBZ,@FQCount,@FQName,@Lores,@jf*@jfbl)
set @ec = @ec | @@error
end
if @ec = 0 begin
commit tran
set @RTN='OK'
end else begin
rollback tran
set @RTN='Update ExtChrData Error !'
end
set nocount off
GO
2、MyGSFun_SetExtChrData1
CREATE proc MyGSFun_SetExtChrData1
@AccountID varchar(10),
@Name varchar(10),
@FQBZ int,
@FQCount int,
@FQName varchar(10),
@Lores int
as
set nocount on
declare @ec int
,@ll int
,@jf int
,@jfbl int
,@RTN varchar(100)
set @jfbl=2 --设置积分兑换比例 1/X
set @ec=0
begin tran
select @ll=LastLores from extchrdata where accountid=@accountid and name=@name
--转换为积分
if @ll is null
set @jf=cast(@Lores/@jfbl as int)
else
set @jf=cast((@Lores-@ll)/@jfbl as int)
update ExtIdData set HaveCents=HaveCents+@jf where AccountID=@AccountID
--set @ec = @ec | @@error --不管积分更新是否成功都应更新角色数据
if @ll is not null begin
update extchrdata set FQName=@FQName,FQBZ=@FQBZ,FQCount=@FQCount
,Lores=@lores,LastLores=LastLores+@jf*@jfbl
where accountid=@accountid and name=@name
set @ec = @ec | @@error
end else begin
insert into extchrdata (AccountID,Name,FQBZ,FQCount,FQName,Lores,LastLores)
values (@AccountID,@Name,@FQBZ,@FQCount,@FQName,@Lores,@jf*@jfbl)
set @ec = @ec | @@error
end
if @ec = 0 begin
commit tran
set @RTN='OK'
end else begin
rollback tran
set @RTN='Update ExtChrData Error !'
end
select @RTN RTN
set nocount off
GO
3、修改你的MyGSFun_GetExtChrData如下:
CREATE proc MyGSFun_GetExtChrData
@Name nvarchar(10),
@AccountID varchar(10)
as
set nocount on
SELECT ExtChrData.*,Character.zs_count as ZSCount,ExtIdData.HaveCents as Cents
from ExtChrData
left join Character on (ExtChrData.Name=Character.AccountID)
left join ExtIdData on (ExtIdData.AccountID=@AccountID)
where ExtChrData.AccountID=@AccountID and ExtChrData.Name=@Name
set nocount off
GO
我的就是这样修改的,GS里的LOG在没出现任何错误提示。
提示,在做这些之前最好,先清空你ExtChrData表里的数据。不要保留任何东西,在改。