如何把T_Temp_V_AnalyseProjectMain变为T_Temp_@User_V_AnalyseProjectMain 其中@user为用户登陆名---字符串替换?select replace(col , 'T_Temp_' , 'T_Temp_@User_') from tb
create table #t (col varchar(40)) insert into #t values('T_Temp_V_AnalyseProjectMain') update #t set col=left(col,7)+'_@User_'+right(col,20) where col='T_Temp_V_AnalyseProjectMain' select * from #t drop table #t T_Temp__@User_V_AnalyseProjectMain
select replace(col , 'T_Temp_' , 'T_Temp_'+@User+'_') from tb
create table #t (col varchar(40)) insert into #t values('T_Temp_V_AnalyseProjectMain') update #t set col=left(col,7)+'_@User_'+right(col,20) where col='T_Temp_V_AnalyseProjectMain' select * from #t drop table #t
晕,不早说! create table #t (col varchar(40)) insert into #t values('T_Temp_V_AnalyseProjectMain') update #t set col=left(col,7)+'_'+@User+'_'+right(col,20) where col='T_Temp_V_AnalyseProjectMain' select * from #t
create table #t (col varchar(40)) insert into #t values('T_Temp_V_AnalyseProjectMain') update #t set col=left(col,7)+@User+right(col,22) where col='T_Temp_V_AnalyseProjectMain' select * from #t
其中@user为用户登陆名---字符串替换?select replace(col , 'T_Temp_' , 'T_Temp_@User_') from tb
insert into #t values('T_Temp_V_AnalyseProjectMain')
update #t set col=left(col,7)+'_@User_'+right(col,20) where col='T_Temp_V_AnalyseProjectMain'
select * from #t
drop table #t
T_Temp__@User_V_AnalyseProjectMain
insert into #t values('T_Temp_V_AnalyseProjectMain')
update #t set col=left(col,7)+'_@User_'+right(col,20) where col='T_Temp_V_AnalyseProjectMain'
select * from #t
drop table #t
create table #t (col varchar(40))
insert into #t values('T_Temp_V_AnalyseProjectMain')
update #t set col=left(col,7)+'_'+@User+'_'+right(col,20) where col='T_Temp_V_AnalyseProjectMain'
select * from #t
insert into #t values('T_Temp_V_AnalyseProjectMain')
update #t set col=left(col,7)+@User+right(col,22) where col='T_Temp_V_AnalyseProjectMain'
select * from #t