如何把T_Temp_V_AnalyseProjectMain变为T_Temp_@User_V_AnalyseProjectMain
其中@user为用户登陆名

解决方案 »

  1.   

    如何把T_Temp_V_AnalyseProjectMain变为T_Temp_@User_V_AnalyseProjectMain 
    其中@user为用户登陆名---字符串替换?select replace(col , 'T_Temp_' , 'T_Temp_@User_') from tb
      

  2.   

    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
      

  3.   

    select replace(col , 'T_Temp_' , 'T_Temp_'+@User+'_') from tb
      

  4.   

    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
      

  5.   

    晕,不早说!
    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
      

  6.   

    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