【发布时间】:2012-08-30 01:13:17
【问题描述】:
我正在尝试使用 SQL Server Management Studio 2008 运行以下查询。
update Schema.[ClientNew]
set [Notes] = ([Notes]+ char(10)+(Select [Notes] from Schema.[clientOld]
where office = 90 and ID = '123456789AM')) where office = 90 and ID= '123456789'
基本上试图将我的笔记字段中的所有数据从 clientOld 合并到 clientnew 中的 notes 字段。
这只是代码的一部分。
拆开时:
Select [Notes] from Schema.[clientOld] where office = 90 and ID = '123456789AM'
在备注字段中给我数据。
但是当我运行查询时,clientNew 表上只出现 {null} 值。
我的查询错了吗??还是在某处写空值?
请指教,
【问题讨论】:
-
ClientNew 在更新前在 Notes 中有空值?
标签: sql sql-server