Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/75.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql 替换字符串的特定部分_Sql_Sql Server 2008 - Fatal编程技术网

Sql 替换字符串的特定部分

Sql 替换字符串的特定部分,sql,sql-server-2008,Sql,Sql Server 2008,在名为my_table的表中,我需要对表内容中的特定字符串执行查找/替换: String to search for: 'http://123.456.789.000' String to substitute: 'http://www.mysite.com' 嗯 能这么简单吗 UPDATE my_table SET Field1 = 'http://www.mysite.com' WHERE Field1 = 'http://123.456.789.000' 祝你好运。?如果列字符串值出

在名为
my_table
的表中,我需要对表内容中的特定字符串执行查找/替换:

String to search for: 'http://123.456.789.000'

String to substitute: 'http://www.mysite.com'

能这么简单吗

UPDATE my_table
SET Field1 = 'http://www.mysite.com'
WHERE Field1 = 'http://123.456.789.000'

祝你好运。

?如果列字符串值出现
'http://123.456.789.000“
这件事很干净,我怀疑你会把它当作一个问题来问。。。您能给我们看一下确切的字符串吗?您添加了“在表内容中”-它还会在哪里?如果您包括列名,以及该字符串是否包含在较大的字符串中,或者是否是整个列的值,那么这将更有帮助。呵呵——如果OP想要类似的匹配,我更喜欢@Aaron的答案。这对精确的会更好。
UPDATE my_table
SET Field1 = 'http://www.mysite.com'
WHERE Field1 = 'http://123.456.789.000'