alter proc replaceImgPath(@yearmonth varchar(36))
as
begin
declare @sqlone varchar(360)
declare @sqltwo varchar(360)
--exec('select picpath1,replace(picpath1,''/upload/UploadFile/'+@yearmonth+'/'','''') from product where len(picpath1)>0 and  picpath1 like ''%'+@yearmonth+'%''')
---修改路径
set @sqlone='update product set picpath1=replace(picpath1,''/upload/UploadFile/'+@yearmonth+'/'','''') where len(picpath1)>0 and picpath1 like ''%'+@yearmonth+'%'''
exec(@sqlone)
---修改为标准路径
set @sqltwo='update product set picpath1=''/upload/UploadFile/'+@yearmonth+'/''+substring(picpath1,charindex(''/'',picpath1)+1,len(picpath1)) where len(picpath1)>0 and picpath1 like ''%'+@yearmonth+'%'' and len(picpath1)<36' --order by len(picpath1)
exec(@sqltwo)
end
go

文章来源:http://www.cnblogs.com/wangdetian168/archive/2008/10/16/1312703.html
posted on 2010-09-30 12:22 sanmao 阅读(152) 评论(0)  编辑  收藏

只有注册用户登录后才能发表评论。


网站导航:
 

常用链接

留言簿(5)

随笔分类

随笔档案

搜索

  •  

最新评论

阅读排行榜

评论排行榜