更新数据库中所有元组的一个字段(MS SQL)

时间:2021-11-22 07:24:57

I've imported a country database from somewhere, with these fields:

我从某处导入了一个国家/地区数据库,其中包含以下字段:

Abbr varchar(2), FullName varchar(50)

An example tuple is:

一个示例元组是:

AL, "Albania"

As you can see, the data in the second field is surrounded by quotation marks. I'd like to remove them, because they make the rest of my code just a little more annoying (I have to remove them programmatically each time).

如您所见,第二个字段中的数据用引号括起来。我想删除它们,因为它们使我的其余代码更烦人(我必须每次以编程方式删除它们)。

Is there a microsoft sql server (2008) Update statement I can run to remove the quotation marks?

是否有一个microsoft sql server(2008)更新语句我可以运行删除引号?

1 个解决方案

#1


UPDATE MyTable
SET FullName = Replace(FullName, '"', '')

#1


UPDATE MyTable
SET FullName = Replace(FullName, '"', '')