由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Database版 - How to concatenate NULL value with a string in SQL Server?
相关主题
Re: How to concatenate NULL value with a string in SQL Server?Urgent SQL problem!
How to write this query请教set和select 的区别
How to get other columns after UNION?beijing呀,教教我怎么optimize sql server吧。
新手问题求助请教大虾问题哈,包子谢哈
关于SQL Server的string function请教一个问题,急, 谢谢
吃了包子, 幹活了!MS SQL Group By Question
not null in ms sqlSQL Query Question
请问sql 有条件性的select columns请教个SQL问题
相关话题的讨论汇总
话题: null话题: fld话题: sql话题: server
进入Database版参与讨论
1 (共1页)
b******d
发帖数: 115
1
This is part of my trigger code:
.....
select @a = FLD_A,
@b = FLD_B,
@c = FLD_C
from inserted
insert into TBL_A
values('A', @a+','+@b+','+@c)
.....
Now the problem is FLD_B may not be populated and thus has a
NULL value in the table. the '+' operator returns NULL if a
NULL string is part of the concatenation. The only way to
get around is to add
if ISNULL(@b)
@b=' '
before the insert.
Is there any better way of doing it? There will be dozens of
fields like FLD_B, and I real
1 (共1页)
进入Database版参与讨论
相关主题
请教个SQL问题关于SQL Server的string function
求教sqlzoo euro 2012 第十三题 (转载)吃了包子, 幹活了!
请帮忙读懂这个sql scriptnot null in ms sql
MS SQL = or like?请问sql 有条件性的select columns
Re: How to concatenate NULL value with a string in SQL Server?Urgent SQL problem!
How to write this query请教set和select 的区别
How to get other columns after UNION?beijing呀,教教我怎么optimize sql server吧。
新手问题求助请教大虾问题哈,包子谢哈
相关话题的讨论汇总
话题: null话题: fld话题: sql话题: server