<SQLError Package="korea_2012_02_02"><Error>Cannot resolve the collation conflict between "Korean_Wansung_CI_AS" and "SQL_Latin1_General_CP1_CI_AS" in the equal to operation.</Error><Assembly>korea_2012_02_02</Assembly><Package>Package1.resx</Package><Batch>Batch6674</Batch><SQL>
/*****************************************************************************
Name:
Desc:
Return-values:
Parameters:
Input
----------------------------
Output
----------------------------
Auth:
Date:
Version:
******************************************************************************
Change History
******************************************************************************
Date: 2009-10-13
----------------------------
Author: Jeon
----------------------------
Description:
----------------------------
컨텐츠 동작방식 설정정보(SettingContentsOption)를 기존 서버셋팅정보(tblServerSettingInfo)와
함께 로딩
******************************************************************************/
CREATE PROCEDURE [dbo].[usp_getServerSettingInfo] AS
SET NOCOUNT ON
EXEC dbo.usp_LogTranCount @@procid
-- 임시 테이블 생성
declare @resultTable table
(
seq int identity ( 1, 1) not null primary key,
fdKey varchar(50) collate database_default,
fdValue varchar(255) collate database_default,
fdOnlyServerSetting bit
)
declare @NowTime datetime;
-- 현재 시간을 얻는다.
set @NowTime = getdate();
-- tblServerSettingInfo테이블의 내용을 임시 테이블에 복사한다.
insert into @resultTable
select fdKey, fdValue, fdOnlyServerSetting
from tblServerSettingInfo
union
select fdKey, fdValue, fdOnlyServerSetting
from SettingContentsOption
-- 스케쥴러 테이블에서 임시테이블에 있는 동일한 키의 값을 임시테이블에 오버라이드 한다.
update @resultTable
set fdValue = t2.fdValue
from @resultTable as t1 left outer join
tblServerSettingScheduler as t2 on
t1.fdKey = t2.fdKey
where t2.fdValue is not null and
@NowTime >= t2.fdStartTime and
@NowTime <= t2.fdEndTime;
select KeyName = fdKey, Value = fdValue , OnlyServerSetting = fdOnlyServerSetting
from @resultTable;
</SQL></SQLError>