1

I'm new to ExactTarget and trying to write a query just to select columns from one table into another to ensure the syntax I'm using is correct and even this basic syntax is not working. Can you please help with how the query should be written?

I want to select the SubscriberKey and StoreName columns and update those columns in Table A which has the exact same columns. When I run the query below, no data is added:

select
s.subscriberkey,
s.storename
from salesorder s

Update

The Primary Key is "SubscriberKey".

SFMC Support noted that the error was because "StoreName" field was not set to Nullable. I've made the changes and the query now runs "without errors", however, only the SubscriberKey and ShopVisits columns are populated in the target Data Extension.

"Select storename" is included in the query but this column is not populated. Do you know what else is missing from the query?

  • What error do you get? – Gaurav Kheterpal Jan 10 '16 at 13:49
  • Hi Gaurav, the error is not indicated I just get a message that an error has occured. When I check the syntax it is valid. – OD88 Jan 11 '16 at 16:46
  • What's the primary key on your target data extension? Does it allow for duplicate subscriberkeys? – Adam Spriggs Jan 11 '16 at 18:27
3

This has been resolved with ET support:

  • storename field needed to be mark as nullable (this was causing the error)
  • syntax updated to include "where storename is not null"

Thanks!

  • Please update your original question with additional details. – Adam Spriggs Jan 14 '16 at 21:09
  • Indeed where storename is not null did the trick. If you have a non-nullable field in the target data extension, use the where clause on this field(with the label of the sync DE field you are using to populate this field) – AshBringer Sep 19 '18 at 9:22
2

Typically if Query Activities fail, it's one of these 4 things:

  1. Primary key violation -- your query results in duplicate rows not allowed by the primary key
  2. Inserting a null value into a non-nullable field
  3. Inserting a value too long for the field (truncation)
  4. Timeout -- if your query doesn't complete within the 30 minute timeout window, it'll error out.

Some Query Activity errors can be viewed in Automation Studio interface. If not, SFMC Support can tell you what the error is from the server log. Some SMFC Partners used to have access to the error log to investigate query runtime errors.

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.