这样的SQL语句怎么转换成存储过程
SQL语句,在ASP中使用:Select Count(id) From SysMessage Where typeid = 1 " & strwhereand & " AND (charindex('," & userlname & ",',','+view_userlname+',') = 0 OR view_userlname is null)
我写的存储过程,但是语法检查有问题
CREATE PROCEDURE count_SysMessage
@userlname nvarchar(100)
@strwhereand nvarchar(300)
AS
Select Count(id) From SysMessage Where typeid = 1 @strwhereand AND (charindex(@userlname,','+view_userlname+',') = 0 OR view_userlname is null)
GO
报错是@strwhereand有错误,我对存储过程还不爱熟悉,我应该怎么写,请大家赐教