Rename column without dropping column? | Community
Skip to main content
Level 6
July 17, 2024
Solved

Rename column without dropping column?

  • July 17, 2024
  • 2 replies
  • 933 views

I need to change this:

<attribute label="Email 2.Informativo" name="EMAILRELACIONALALERTAS" type="string"/>
to:

<attribute label="Email 2.Informativo" name="EMAILINFORMATIVO" type="string"/>

But  changing the "name" attribute and ACC wants to drop the whole column. ACC creates this SQL:


-- Log: Updating table 'NmsRecipient'
ALTER TABLE NmsRecipient
ADD COLUMN sEMAILINFORMATIVO VARCHAR(255),
ADD COLUMN sTELEFMOVILINFORMATIVO VARCHAR(255);
ANALYZE NmsRecipient;
ALTER TABLE NmsRecipient
DROP COLUMN semailrelacionalalertas,
DROP COLUMN stelefmovilmarketing;

I only need to change column name...

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Manoj_Kumar

Hello @god_prophet  I would suggest you to create the new column and the duplicate the data using combination of query and update data activity.

Once the data is in the new column then you can remove the old column.

2 replies

Manoj_Kumar
Community Advisor
Manoj_KumarCommunity AdvisorAccepted solution
Community Advisor
July 17, 2024

Hello @god_prophet  I would suggest you to create the new column and the duplicate the data using combination of query and update data activity.

Once the data is in the new column then you can remove the old column.

Manoj     Find me on LinkedIn
Amine_Abedour
Community Advisor
Community Advisor
July 19, 2024

Hello @god_prophet,

 

You can force the colomn sql name to the old sql name so that Adobe does not try to drop and recreate it like this :

 

<attribute label="Email 2.Informativo" name="EMAILINFORMATIVO" sqlname="semailrelacionalalertas" type="string"/>

 

 

Br,

 

Amine ABEDOUR