34,576
社区成员
发帖
与我相关
我的任务
分享
declare @bc varchar(100),@ec varchar(100)
select @bc = '%<a%></a>%',@ec='></a>'
while exists(select 1 from tb where patindex(@bc,col)>0)
update tb set col = stuff(col,patindex(@bc,col)
,charindex('@ec,col,patindex(@bc,col))
-patindex(@bc,col)+5,'')
where patindex(@bc,col)>0
while exists(select 1 from tb where patindex('%<a%></a>%',col)>0)
update tb set col = stuff(col,patindex('%>%></a>%',col)
,charindex('></a>',col,patindex('%>%></a>%',col))
-patindex('%>[^<]%</a>%',col)+5,'')
where patindex('%>%></a>%',col)>0
while exists(select 1 from tb where patindex('%>[^<]%</a>%',col)>0)
update tb set col = stuff(col,patindex('%>[^<]%</a>%',col)+1
,charindex('</a>',col,patindex('%>[^<]%</a>%',col)+1)
-patindex('%>[^<]%</a>%',col)-1,'')
where patindex('%>[^<]%</a>%',col)>0
update Table1
set COl=''
where
len(substring(Col,charindex('<a',Col)+2,charindex('</a>',COL)-3))=0 and Col like '<a%</a>%'
UPDATE TableN
SET ColName=REPLACE(ColName,'<a> </a>','')
WHERE ColName LIKE '%<a> </a>%')
UPDATE TableN
SET ColName=REPLACE(ColName,'<a> </a>','')
WHERE ColName LIKE '%<a>%</a>%')
UPDATE TableN
SET ColName=REPLACE(ColName,'<a> </a>','')
WHERE ColName LIKE '%<a>%</a>%')