Question
August 23, 2007 at 04:03 AM
dcleary

Exporting fields from SQL server with prefixes……..

by dcleary . Updated 18 years, 11 months ago

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

This discussion is locked

All Comments