CREATE TABLE #temp (
emp_name NVARCHAR(200) NOT NULL,
emp_middlename NVARCHAR(200) NULL,
emp_lastname NVARCHAR(200) NOT NULL
INSERT INTO #temp VALUES( ‘SQL’, NULL, ‘Authority’ );
INSERT INTO #temp VALUES( ‘SQL’, ‘Server’, ‘Authority’ );
SELECT emp_name + emp_middlename + emp_lastname AS Result
DROP TABLE #temp;
As you can see, the problem is getting the first value as NULL
What would you do in this situation?
Can you think of a solution without using the ISNULL function?