title: Creating a view. Replacing a NULL value with an empty string. SQL
body: <p>I want to create a view from a table where we have a FirstName, LastName and MiddleName column and where the MiddleName might be NULL, plus a salary. I need to replace the MiddleName with and empty string where there's not MiddleName. I'm using SQL Management Studio.
  I came up with this code:</p>
  
  <pre><code>CREATE VIEW V_EmployeeNameJobTitle AS
  SELECT FirstName  + ' ' + MiddleName + ' ' + LastName AS [Fullname], Salary FROM Employees WHERE MiddleName IS NOT NULL
  UNION SELECT FirstName  + ' ' + LastName AS [Fullname], Salary FROM Employees WHERE MiddleName IS NULL 
  </code></pre>
  
  <p>But this doesn't seem to work as I wanted to, and it's not very pretty. Any other suggestions how I might shorten this. Thanks in advance.</p>