# Core Attributes - Bulk Update

{% hint style="info" %}

### Ensure you have completed [Attribute Metadata Bulk Updates (Core) - Setup](/guides/how-to-guides-bulk-upsert-via-csv/database-object-initialization/core-attributes-initialization.md)

{% endhint %}

### Open a new SQL file Snowflake workspace

![](https://colony-recorder.s3.amazonaws.com/files/2026-01-23/4b391681-1194-493e-87ae-5b5e550c0857/ascreenshot_294d708fbe9e4bff8033a5f4c50a35c2_text_export.jpeg)

### Run a select statement for datapancake.core.vw\_datasource\_all\_attributes

The minimum field requirements to select are `attribute_id, polymorphic_version_id` - for example:

```sql
select ATTRIBUTE_ID, POLYMORPHIC_VERSION_ID
from datapancake.core.vw_datasource_attribute_security
where version_status = 'active';
```

#### Select statement for updating attributes where the source data type is an array

<pre class="language-sql"><code class="lang-sql"><strong>select
</strong>-- VIEW ONLY COLUMNS
DATASOURCE_ID,
ATTRIBUTE_ID,
POLYMORPHIC_VERSION_ID,
DATASOURCE_NAME,
DATASOURCE_TAG,
VERSION_NUMBER,
VERSION_STATUS_DATE,
PARENT_OBJECT,
PARENT_ARRAY,
ATTRIBUTE_PATH,
ATTRIBUTE_NAME,
ATTRIBUTE_LEVEL,
ATTRIBUTE_ORDER,
SOURCE_DATA_TYPE,
POLYMORPHIC_ATTRIBUTE_NAME,
ARRAY_TYPE,
ARRAY_PRIMITIVE_TYPE,
-- EDITABLE COLUMNS (Array-specific)
INCLUDE_ARRAY_IN_CODE_GEN, --TRUE, FALSE
ARRAY_RELATIONSHIP_NAME,
ARRAY_RELATIONSHIP_DESCRIPTION,
ARRAY_RELATIONSHIP_TYPE, --many_to_one, one_to_one
ARRAY_RELATIONSHIP_JOIN_TYPE, --left_outer, inner
SEMANTIC_LAYER_ALIAS_NAME,
FLATTEN_ARRAY, --TRUE, FALSE
-- AUDIT COLUMNS
ATTRIBUTE_LAST_UPDATED_DATETIME,
ATTRIBUTE_LAST_UPDATED_BY
from datapancake.core.vw_datasource_all_attributes
where version_status = 'active'
and SOURCE_DATA_TYPE = 'array'
order by attribute_path;
</code></pre>

#### Select statement for updating attributes where source data types are primitive and object

```sql
select
-- VIEW ONLY COLUMNS
DATASOURCE_ID,
ATTRIBUTE_ID,
POLYMORPHIC_VERSION_ID,
DATASOURCE_NAME,
DATASOURCE_TAG,
VERSION_NUMBER,
VERSION_STATUS_DATE,
PARENT_OBJECT,
PARENT_ARRAY,
ATTRIBUTE_PATH,
ATTRIBUTE_NAME,
ATTRIBUTE_LEVEL,
ATTRIBUTE_ORDER,
SOURCE_DATA_TYPE,
POLYMORPHIC_ATTRIBUTE_NAME,
SAMPLE_VALUE,
HAS_EMBEDDED_CONTENT,
DATA_PLATFORM_DATA_TYPE,
-- EDITABLE COLUMNS (Non-array attributes)
ATTRIBUTE_RECORD_STATUS,
INCLUDE_COLUMN_IN_SECURE_VIEW,
NUMERIC_PRECISION,
NUMERIC_SCALE,
USE_DATETIME_FORMAT,
DATETIME_FORMAT,
ATTRIBUTE_RECORD_STATUS,
IS_UNIQUE,
IS_PRIMARY_KEY,
CONTAINS_ENUM_VALUES,
RAW_TRANSFORMATION_TYPE,
RAW_TRANSFORMATION_EXPRESSION,
RAW_TRANSFORMATION_EXPRESSION_COMMENT,
RAW_NULL_VALUE_EXPRESSION,
SEMANTIC_LAYER_TRANSFORMATION_EXPRESSION,
SEMANTIC_LAYER_TRANSFORMATION_EXPRESSION_COMMENT,
RAW_ALIAS_NAME,
SEMANTIC_LAYER_ALIAS_NAME,
CONSOLIDATION_REGEX_SEARCH,
CONSOLIDATION_SQL_EXPRESSION,
-- AUDIT COLUMNS
ATTRIBUTE_LAST_UPDATED_DATETIME,
ATTRIBUTE_LAST_UPDATED_BY
from datapancake.core.vw_datasource_all_attributes
where version_status = 'active'
and SOURCE_DATA_TYPE != 'array'
order by attribute_path;
```

{% hint style="info" %}
You can choose which editable fields you wish to include in your select statement.
{% endhint %}

![](https://colony-recorder.s3.amazonaws.com/files/2026-01-23/b327ab4a-e541-4bb0-8fff-0fdbd1da96c5/ascreenshot_0c40b3c393534615b71e22a54f94ee76_text_export.jpeg)

### Verify the query successfully returns a list of attribute metadata

![](https://colony-recorder.s3.amazonaws.com/files/2026-01-23/6854ca13-27aa-47e2-9088-b96f64feed73/ascreenshot_fce689aaf5be41f1838592dbaa8545ac_text_export.jpeg)

### Download the results as a .csv file

![](https://colony-recorder.s3.amazonaws.com/files/2026-01-23/f70b1a0a-d38a-43dd-ab18-8cf961d1f7db/ascreenshot_dc8fef5b5b7840b799fee9afd14c08fa_text_export.jpeg)

### Open the .csv file in either Excel or Google Sheets

![](https://ajeuwbhvhr.cloudimg.io/https://colony-recorder.s3.amazonaws.com/files/2025-06-24/166d997b-67c7-44df-a522-984aec4ab6e7/ascreenshot.jpeg?tl_px=109,0\&br_px=1486,769\&force_format=jpeg\&q=100\&width=1120.0\&wat=1\&wat_opacity=1\&wat_gravity=northwest\&wat_url=https://colony-recorder.s3.amazonaws.com/images/watermarks/FB923C_standard.png\&wat_pad=524,129)

### Edit any editable columns as needed

![](https://ajeuwbhvhr.cloudimg.io/https://colony-recorder.s3.amazonaws.com/files/2025-06-24/3dcc3276-5b44-4d03-bc5e-d511fb39a13c/ascreenshot.jpeg?tl_px=164,0\&br_px=1541,769\&force_format=jpeg\&q=100\&width=1120.0\&wat=1\&wat_opacity=1\&wat_gravity=northwest\&wat_url=https://colony-recorder.s3.amazonaws.com/images/watermarks/FB923C_standard.png\&wat_pad=643,123)

### Save (Excel) or download (Google Sheets) the file

![](https://ajeuwbhvhr.cloudimg.io/https://colony-recorder.s3.amazonaws.com/files/2025-06-24/1d878217-47d1-4e0b-9beb-5b32f76fd18a/ascreenshot.jpeg?tl_px=0,46\&br_px=1376,815\&force_format=jpeg\&q=100\&width=1120.0\&wat=1\&wat_opacity=1\&wat_gravity=northwest\&wat_url=https://colony-recorder.s3.amazonaws.com/images/watermarks/FB923C_standard.png\&wat_pad=459,277)

### Load the .csv into your stage

![](https://ajeuwbhvhr.cloudimg.io/https://colony-recorder.s3.amazonaws.com/files/2025-06-25/b95a896b-a5e6-41e4-bf02-8f6ebeca882f/ascreenshot.jpeg?tl_px=0,8\&br_px=1376,777\&force_format=jpeg\&q=100\&width=1120.0\&wat=1\&wat_opacity=1\&wat_gravity=northwest\&wat_url=https://colony-recorder.s3.amazonaws.com/images/watermarks/FB923C_standard.png\&wat_pad=239,276)

![](https://ajeuwbhvhr.cloudimg.io/https://colony-recorder.s3.amazonaws.com/files/2025-06-25/e03c17ff-fde1-4bd3-b412-c33e3fe39724/ascreenshot.jpeg?tl_px=164,0\&br_px=1541,769\&force_format=jpeg\&q=100\&width=1120.0\&wat=1\&wat_opacity=1\&wat_gravity=northwest\&wat_url=https://colony-recorder.s3.amazonaws.com/images/watermarks/FB923C_standard.png\&wat_pad=1005,7)

![](https://ajeuwbhvhr.cloudimg.io/https://colony-recorder.s3.amazonaws.com/files/2025-06-25/ff23955f-4c43-4781-885a-58c1cd46cc6b/ascreenshot.jpeg?tl_px=68,0\&br_px=1445,769\&force_format=jpeg\&q=100\&width=1120.0\&wat=1\&wat_opacity=1\&wat_gravity=northwest\&wat_url=https://colony-recorder.s3.amazonaws.com/images/watermarks/FB923C_standard.png\&wat_pad=524,257)

![](https://ajeuwbhvhr.cloudimg.io/https://colony-recorder.s3.amazonaws.com/files/2025-06-25/f34d74ef-8a5b-413a-a39a-20aa0849aeab/ascreenshot.jpeg?tl_px=164,223\&br_px=1541,993\&force_format=jpeg\&q=100\&width=1120.0\&wat=1\&wat_opacity=1\&wat_gravity=northwest\&wat_url=https://colony-recorder.s3.amazonaws.com/images/watermarks/FB923C_standard.png\&wat_pad=664,372)

### Run the bulk update stored procedure

{% hint style="info" %}
Modify the \<placeholders> with the same database and schema you uploaded the stored procedure to.
{% endhint %}

When the stored procedure completes, the attribute metadata file will be moved to the archive folder.

```sql
call <database>.<schema>.sp_update_datapancake_attribute_metadata_core(
    '@<stage_name>/<staged_filename>.csv',
    '@<stage_name>/<archive_folder>/',
    '<snowflake_username>'
);
```

### Verify the integration completed successfully by running the following query

```sql
select * from datapancake.core.vw_integration_process
where user_name = 'BWOLFF'
order by integration_process_date desc;
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.datapancake.com/guides/how-to-guides-bulk-upsert-via-csv/usage/core-attributes-bulk-update.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
