USE [RohanGame]
GO
/****** Object: StoredProcedure [dbo].[ROHAN2_ReloadNoticeSystem] Script Date: 8/31/2022 3:32:54 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
/*================================================= =
@

weonia
@

2011-11-03
서버가 실행된후 수정된 공지를 타입별로 읽어온다.
================================================== */
CREATE procedure [dbo].[ROHAN2_ReloadNoticeSystem]
@

tinyint
as
set nocount on
--롤링공지 최대 개수는 14개
declare @

t int
if (select count(*) from TRollingNotice where applied = 1 and camp = @

) <> 0
begin
select top 14 seq, camp, period, content
from TRollingNotice
where content is not null and camp = @
update TRollingNotice set applied = 0
where camp = @
set @

t =@@error
end
else
begin
select top 1 seq, camp, period, content
from TRollingNotice
where applied = 1 and camp = @

set @

t = -1
end
return @

t
GO