0

We are working on a use case where we needto add a prefix to our ID column. E.g. we have the real ID - e.g. 123xyz - and it shall have a prefix STAGE>> STAGE_123xyz is the final ID. Every record in this column shall have this prefix. Is there a 'simple' way to do this with a query activity?

2

Basically you can. But you need to be carefull with the results.

If you're trying to update the Primary Key of you DE, you'll end up with x2 times the number of rows on your DE because the PREFIX+ID in each row will be considered as a new ID and hence a new row.

Try something like the SQL below and add as much columns as you want with the same way as long as it's not your primary key:

SELECT 
   COLUMNNAME = 'YOURPREFIX_' + COLUMNNAME
FROM YOUR_DE

Here, we are concatening the prefix with the old value of the column and overwriting it with the new string using =.

However, If you need to update the primary key as well, you'll probably need to create a new DE and copy all your data with the prefix appended..

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.