Create a Data Extension

Use a data extension to store information about your subscribers.

When you use SOAP API to create data extensions, observe these guidelines:

  • Limit external keys for data extensions to 36 characters. You can create external keys that exceed this limit, but doing so can negatively impact other processes.
  • Don't use Date values as primary keys. When you retrieve a column that contains the Date data type, SOAP API returns a value that’s rounded to the nearest second, followed by AM or PM. This behavior occurs even when the source timestamp contains millisecond data. As a result, if you use a Date column as a primary key, it can prevent you from retrieving unique rows.

This sample SOAP envelope represents a request to create a data extension called DataExtensionFromAPI. The data extension contains 4 fields: EmailAddress, ChannelUser, ChannelUser_EmailAddress, and Demographic_Address.

If the API accepts the request to create a data extension, the response includes the external key, name, and fields for the data extension.

This sample SOAP envelope creates a data extension with a non-nullable field by including IsPrimaryKey and IsRequired values.

This sample SOAP envelope includes an example of data extension field types.

When you create a field with the Decimal data type in a data extension, specify the precision and scale of the field.

When you create a data extension field that contains a date value, pass the time in 24-hour format.