【问题标题】:How to replace column text in SQL Table?如何替换 SQL 表中的列文本?
【发布时间】:2011-02-16 01:24:15
【问题描述】:

我在表 CommunitiesPostings 中有名为 CommPostCommUrl 的列具有文本值。

CommPostCommUrl
--------------------
http://communities.site.com/TIGS
http://communities.site.com/TIGS
http://communities.site.com/Leaders
http://communities.site.com/Specialty
http://communities.site.com/Specialty
http://communities.site.com/PN
http://communities.site.com/TIGS/SIM

将列文本替换为

CommPostCommUrl
--------------------
http://communitiesdev.site.com/TIGS
http://communitiesdev.site.com/TIGS
http://communitiesdev.site.com/Leaders
http://communitiesdev.site.com/Specialty
http://communitiesdev.site.com/Specialty
http://communitiesdev.site.com/PN
http://communitiesdev.site.com/TIGS/SIM

请给我查询

【问题讨论】:

标签: sql-server sql-server-2005 tsql stored-procedures


【解决方案1】:
UPDATE Table
SET CommonPostURL = REPLACE(CommonPostURL , 
                            'http://communities.',
                            'http://communitiesdev.')

【讨论】:

    【解决方案2】:
    UPDATE CommunitiesPostings
    SET CommPostCommUrl = REPLACE (CommPostCommUrl,'communities','communitiesdev')
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-03-20
      • 1970-01-01
      • 1970-01-01
      • 2021-05-19
      • 2012-12-30
      • 1970-01-01
      相关资源
      最近更新 更多