首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > SQL Server >

很难得update 高手们来看看。只更新某数据。该如何处理

2012-06-09 
很难得update 高手们来看看。。只更新某数据。比如,数据如下.在.user表中的字段.用户名 数据.1230xFFFFFFFFFF

很难得update 高手们来看看。。只更新某数据。
比如,数据如下.
在.user表中的字段.
用户名 数据.
123 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0200FF00000001000000000000000000FFFFFFFFFFFFFFFFF
  FFFFF1100FFFFFFFFF31F0000000000000000FFFFFFFFF1000FFFFFFFFF71F0000000000000000

红色部分是要改的。而。FFFFFFFFFFFFFFFF为空的数据。不能去改。
这样的有办法修改吗??

[解决办法]

SQL code
CREATE TABLE #USER       ([用户] VARCHAR(10),        [数据] VARCHAR(1000))INSERT #USERSELECT '123','0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0200FF00000001000000000000000000FFFFFFFFFFFFFFFFFFFFFF1100FFFFFFFFF31F0000000000000000FFFFFFFFF1000FFFFFFFFF71F0000000000000000' UNION ALLSELECT '456','0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0200FF00000001000000000000000000FFFFFFFFFFFFFFFFFFFFFF1100FFFFFFFFF31F0000000000000000FFFFFFFFF1000FFFFFFFFF71F0000000000000000'UPDATE #USER   SET [数据]=REPLACE([数据],'02','88')   WHERE [用户]='456'UPDATE #USER   SET [数据]=REPLACE([数据],'1000','8888')   WHERE [用户]='456'UPDATE #USER   SET [数据]=REPLACE([数据],'1100','8888') WHERE [用户]='456'UPDATE #USER   SET [数据]=REPLACE([数据],'31F','888')   WHERE [用户]='456'SELECT * FROM #USER/*用户         数据---------- ----------------------------------------------------------------------------------------------------------------123        0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0200FF00000001000000000000000000FFFFFFFFFFFFFFFFFFFFFF1100FFFFFFFFF31F0000000000000000FFFFFFFFF1000FFFFFFFFF71F0000000000000000456        0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8800FF00000008888000000000000000FFFFFFFFFFFFFFFFFFFFFF8888FFFFFFFFF8880000000000000000FFFFFFFFF8888FFFFFFFFF71F0000000000000000*/ 

热点排行