这个存储过程错在哪,谢谢
CREATE PROCEDURE AdgroupArtDeleteUid
(@uid int,@tagid varchar(18))
AS
begin
declare @con varchar(512)
declare @sql varchar(1024)
if(@uid=0)
begin
if(@tagid= ' ')
set @con = ' '
else
set @con = 'where tagid like %, '+@tagid + ',% '
end
else
begin
if(@tagid= ' ')
set @con = 'where uid= '+str(@uid)
else
set @con = 'where uid= '+str(@uid)+ ' and tagid like %, '+@tagid+ ',% '
end
set @sql = 'delete t_adgroupart '+@con
end
exec (@sql)
GO
------解决方案--------------------like ' '%, '+@tagid+ ',% ' ' '