ALTER PROCEDURE [dbo].[baslangicitem]
@account varchar(21)
AS
begin
declare @class smallint
select @class = cast(substring(cast(class as varchar(3)),2,2) as varchar(2)) from userdata where struserid=@account
if @class=1 or @class=5 or @class=6
set @class = 1 --War
if @class=2 or @class=7 or @class=8
set @class = 2 -- Rog
if @class=3 or @class=9 or @class=10
set @class = 3 --Mag
if @class=4 or @class=11 or @class=12
set @class = 4 -- Pri
update userdata set stritem = (select stritem from baslangic where class=@class) where struserid=@account
end
@account varchar(21)
AS
begin
declare @class smallint
select @class = cast(substring(cast(class as varchar(3)),2,2) as varchar(2)) from userdata where struserid=@account
if @class=1 or @class=5 or @class=6
set @class = 1 --War
if @class=2 or @class=7 or @class=8
set @class = 2 -- Rog
if @class=3 or @class=9 or @class=10
set @class = 3 --Mag
if @class=4 or @class=11 or @class=12
set @class = 4 -- Pri
update userdata set stritem = (select stritem from baslangic where class=@class) where struserid=@account
end