|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Case nullCASE(@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.
-- Show quoteTibor Karaszi, SQL Server MVP http://www.karaszi.com/sqlserver/default.asp http://www.solidqualitylearning.com/ "Justin" <jus***@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? > CASE WHEN @CustomText IS NULL THEN ... END
or just use COALESCE COALESCE(@CustomText + ' ' + @StatusDescription, @StatusDescription) Show quote "Justin" <jus***@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? > |
|||||||||||||||||||||||