CASE(@.CustomText) WHEN NULL THEN 'Status changed to ' +
@.StatusDescription
ELSE @.CustomText + ' ' +
@.StatusDescription END
Now, @.CustomText is either null or has value. WHEN NULL does not work. How
do i get it to work?Already replied to other post.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Justin" <jus820@.hotmail.com> wrote in message news:evOIVwreGHA.2456@.TK2MSFTNGP04.phx.gbl..
.
> CASE(@.CustomText) WHEN NULL THEN 'Status changed to ' + @.StatusDescri
ption
> ELSE @.CustomText + ' ' + @.StatusDe
scription END
>
> Now, @.CustomText is either null or has value. WHEN NULL does not work. H
ow do i get it to work?
>|||CASE WHEN @.CustomText IS NULL THEN ... END
or just use COALESCE
COALESCE(@.CustomText + ' ' + @.StatusDescription, @.StatusDescription)
"Justin" <jus820@.hotmail.com> wrote in message
news:evOIVwreGHA.2456@.TK2MSFTNGP04.phx.gbl...
> CASE(@.CustomText) WHEN NULL THEN 'Status changed to ' +
> @.StatusDescription
> ELSE @.CustomText + ' ' +
> @.StatusDescription END
>
> Now, @.CustomText is either null or has value. WHEN NULL does not work.
> How do i get it to work?
>
Thursday, March 22, 2012
Case null
Labels:
case,
customtext,
database,
endnow,
microsoft,
mysql,
null,
oracle,
server,
sql,
status,
statusdescription,
statusdescriptionelse
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment