config.usp_parameter_set - P

type: P ( stored procedure ), modify_date: 2021-08-11 13:00:12

RepoObject_guid: 9990291C-9D61-EB11-84DC-A81E8446D5B0

Description

Examples

Parameters

  • @Parameter_name (varchar(100))

  • @sub_Parameter (nvarchar(128))

  • @Parameter_value (nvarchar(max))

Entity Diagram

entity-config.usp_parameter_set

References

Referenced Objects

Referencing Objects

Object Reference Diagram - 1 1

entity_1_1_objectref-config.usp_parameter_set

Object Reference Diagram - Referenced - 30 0

entity_30_0_objectref-config.usp_parameter_set

Object Reference Diagram - Referencing - 0 30

entity_0_30_objectref-config.usp_parameter_set

sql_modules_definition

config.usp_parameter_set - P script
CREATE Procedure [config].[usp_parameter_set]
(
    @Parameter_name  Varchar(100)
  , @sub_Parameter   NVarchar(128) = ''
  , @Parameter_value NVarchar(Max)
)
As
--
Update
    p
Set
    Parameter_value = @Parameter_value
From
    [config].Parameter p
Where
    p.Parameter_name    = @Parameter_name
    And p.sub_Parameter = @sub_Parameter;

--IF NOT EXISTS
--(
--    SELECT
--           [col]
--    FROM
--         [repo].[Parameter] AS p
--    WHERE  [p].[Parameter_name] = @Parameter_name
--           AND [p].[sub_Parameter] = @sub_Parameter
--)
Insert Into [config].Parameter
(
    Parameter_name
  , sub_Parameter
  , Parameter_value
)
Select
    @Parameter_name
  , @sub_Parameter
  , @Parameter_value
Where
    Not Exists
(
    Select
        1
    From
        [config].Parameter As p
    Where
        p.Parameter_name    = @Parameter_name
        And p.sub_Parameter = @sub_Parameter
);