I have two databases, with the following tables:
DatabaseA
TableA
ColumnA (varChar(10)
DatabaseB
TableB
ColumnB (varChar(10)
I need a query that:
- Ignores NULLs or empty strings
- Finds rows where the value of ColumnA does not exist in columnB
- In this case, replaces the value of the non matching row in ColumnA with ” (empty string)
This is in a MS SQL Server 2008 environment.
You can do this with a
LEFT OUTER JOINas shown below: