If else in stored procedure sql server

后端 未结 8 1669
孤街浪徒
孤街浪徒 2021-02-02 07:19

I have created a stored procedure as follow:

Create Procedure sp_ADD_USER_EXTRANET_CLIENT_INDEX_PHY
(
@ParLngId int output
)
as
Begin
    SET @ParLngId = (Select         


        
8条回答
  •  南笙
    南笙 (楼主)
    2021-02-02 07:23

    Instead of writing:

    Select top 1 ParLngId from T_Param where ParStrNom = 'Extranet Client'
    

    Write:

    Select top 1 ParLngId from T_Param where ParStrNom IN 'Extranet Client'
    

    i.e. replace '=' sign by 'IN'

提交回复
热议问题