How do I pass a list as a parameter in a stored procedure?

前端 未结 7 1508
暖寄归人
暖寄归人 2020-12-02 22:15

Looking to pass a list of User IDs to return a list names. I have a plan to handle the outputed names (with a COALESCE something or other) but trying to find the best way to

相关标签:
7条回答
  • 2020-12-02 23:03

    Maybe you could use:

    select last_name+', '+first_name 
    from user_mstr
    where ',' + @user_id_list + ',' like '%,' + convert(nvarchar, user_id) + ',%'
    
    0 讨论(0)
提交回复
热议问题