如何批量替换数据库字段的内容 update yourtable set yourcol=replace(replace(yourcol,'.avi','.wmv'),'.mpg','.wmv') 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 --测试:create table #t(yourcol varchar(20))insert into #T select 'a.avi'insert into #T select 'a.mpg'insert into #T select 'a.wmv'insert into #T select 'a.avi'select * from #Tupdate #t set yourcol=replace(replace(yourcol,'.avi','.wmv'),'.mpg','.wmv')select * from #Tdrop table #t update 表 set 字段 = '1234.wmv' from 表 where 字段='1234.avi'update 表 set 字段 = '2345.wmv' from 表 where 字段='2345.wmv' declare @d1 varchar(50)set @d1 = '12345.svs'print replace(@d1,right(@d1,len(@d1)-charindex('.',@d1)),'wmv') update 表 set 字段= replace(字段,right(字段,len(字段)-charindex('.',字段)),'wmv') 请教下vwd2005如何连接mdf文件 如何能往sql2000中存入汉字 可以实现这个吗 同步问题? 怎么样用函数或其它办法实现以下功能? SET NOCOUNT ON是什么作用? 事务名的问题 請教一個SQL查詢﹐謝謝 store procedure question! 请问如何用SQL语言从数据源中取出所有表名? 字符串转时间格式问题 数据库高手请进!
create table #t
(
yourcol varchar(20)
)
insert into #T select 'a.avi'
insert into #T select 'a.mpg'
insert into #T select 'a.wmv'
insert into #T select 'a.avi'
select * from #T
update #t set yourcol=replace(replace(yourcol,'.avi','.wmv'),'.mpg','.wmv')
select * from #T
drop table #t
set @d1 = '12345.svs'
print replace(@d1,right(@d1,len(@d1)-charindex('.',@d1)),'wmv')