存储过程中的where in实现

在项目中使用Npoco时发现where in查询总是不能起作用。寻觅了许久终于找到解决方案,特此记录下:

Declare  @p Varchar(500)
Set @p='CoreRole,CorePassword,CoreOnlineUser'
SELECT * FROM [Menus] 
where charindex(','+ModuleName+',',','+@p+',')>0
原文地址:https://www.cnblogs.com/kelite/p/3490508.html