Update Column Properties for a Data Extension

You can use SOAP API to update column properties in an existing data extension to change how the data extension handles information. For example, you can change the number of characters allowed in a field.

We recommend that you use REST API operations to update data extensions instead of using SOAP API. See UpdateDataExtension.

Note

Sample SOAP Envelope 

To modify a field in a data extension, you must specify the ObjectID for the DataExtensionField object. If you don’t specify an ObjectID, SOAP API adds a new column with the same name as the existing column, which produces an error. Use the Retrieve method on the DataExtensionField object to find the ObjectID.

1<soap:envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
2  <soap:header>
3    <wsse:security soap:mustunderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
4      <wsse:usernametoken wsu:id="UsernameToken-1" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
5        <wsse:username>ccc</wsse:username>
6        <wsse:password type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">ccc</wsse:password>
7      </wsse:usernametoken>
8    </wsse:security>
9  </soap:header>
10  <soap:body>
11    <updaterequest xmlns="http://exacttarget.com/wsdl/partnerAPI" xmlns:ns2="urn:fault.partner.exacttarget.com">
12      <objects xsi:type="DataExtension" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
13        <PartnerKey xsi:nil="true"></PartnerKey>
14        <ModifiedDate xsi:nil="true"></ModifiedDate>
15        <ObjectID xsi:nil="true"></ObjectID>
16        <CustomerKey>ExampleDataExtension</CustomerKey>
17        <fields>
18          <field>
19            <PartnerKey xsi:nil="true"></PartnerKey>
20            <ModifiedDate xsi:nil="true"></ModifiedDate>
21            <ObjectID>239a63a4-e5a3-4bca-9f72-f731f793a47a</ObjectID>
22            <Name>FieldOne</Name>
23            <DefaultValue></DefaultValue>
24            <MaxLength>80</MaxLength>
25          </field>
26        </fields>
27      </objects>
28    </updaterequest>
29  </soap:body>
30</soap:envelope>