CREATE PROC DNNIT_FAQ_UpdateSetting
@ModuleId int,
@Setting varchar(50),
@Value int
AS
DECLARE @Id int
SELECT @Id = SettingId FROM DNNIT_FAQ_Settings WHERE ModuleId = @ModuleId AND Setting = @Setting
IF(@Id IS NOT NULL)
UPDATE DNNIT_FAQ_Settings
SET
Value = @Value
WHERE
SettingId = @Id
ELSE
INSERT INTO DNNIT_FAQ_Settings
(
ModuleId, Setting, Value
)
VALUES
(
@ModuleId, @Setting, @Value
)
沒有留言:
張貼留言