Rabu, 19 Januari 2011

SQL SERVER: 3 Methods to Handle NULL for String Concatenation

If any of parameter/value used in string concatenation is found NULL, whole result becomes NULL.DECLARE @FirstVal VARCHAR(10),@SecondVal VARCHAR(10),@ThirdVal VARCHAR(10),@ForthVal VARCHAR(10) SELECT @FirstVal ='First',@ThirdVal ='Third'SELECT @FirstVal + @SecondVal + @ThirdValollowing are three commonly used methods can solve this problem1.  Using ISNULL()It takes two parameters, original

Tidak ada komentar:

Posting Komentar