SP 获取输入值 ListType_IDs,它是列表类型的逗号分隔值。
create procedure test
@ListType_IDs varchar(255) = null
as
declare @IsGetDirectReports bit
declare @IsGetDirectReportsManagers bit
declare @IsGetAllManagers bit
declare @IsGetFullTeamUnderManager bit
--I have to initialize the above flags based on the value of list type IDs
例如,让 ListType_IDs=5,6,7
@IsGetDirectReports = 1,如果 @ListType_IDs 的值为 5
@IsGetDirectReportsManagers = 1,如果 @ListType_IDs 的值为 6
@IsGetFullTeamUnderManager = 1,如果 @ListType_IDs 的值为 7
我需要使用简单的 SQL 代码来实现它。任何人请帮忙。提前致谢。