well, I'm not sure this will work, but try it if you can:
Code:
USE [SRO_VT_SHARD]
GO
/****** Object: StoredProcedure [dbo].[_EditGuildStat] Script Date: 06/22/2013 01:42:57 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
----
ALTER procedure [dbo].[_EditGuildStat]
@Name varchar(64),
@lvl tinyint,
@sp int,
@LastCrestRev int,
@CurCrestRev int
as
-- not existing guild
declare @id int
set @id = 0
select @id = [ID] from _guild where [Name] = @Name
if (@@rowcount = 0 or @id is null or @id = 0)
begin
select -2
return
end
IF(@sp > 2147483647)
BEGIN
SELECT @sp = 2147483647
END
-- failed to update
update _guild set Lvl = @lvl, GatheredSP = @sp, LastCrestRev = @LastCrestRev, CurCrestRev = @CurCrestRev where [ID] = @id
if (@@error <> 0 or @@rowcount = 0)
begin
select -4
return
end
select 1
return