Exporting fields from SQL server with prefixes........
Hello
I'm trying to export some data with prefixed codes against each field. Which will be then imported into another legacy system using the codes as positional pointers.
e.g:
Name.......Address.......Location
001Smith...002High St....003Manchester
This I can do with no probs:
SELECT
'001'+Name,
'002'+Address,
'003'+Location
FROM
TableName
However looking at the overall data export if there are NULL values in the data it correctly displays just the code on its own.
What I really want is that if the field is NULL then do not insert the code.
I only want codes against fields with data in.
Can anybody think of a SQL solution or a way I can get around this.
Thank you