# How to Generate Dynamic SQL Statement Code

### Open the Pipeline Designer and select your datasource

![](https://ajeuwbhvhr.cloudimg.io/https://colony-recorder.s3.amazonaws.com/files/2025-12-02/a95b5d8c-e376-4799-9be5-c0002b95ec59/ascreenshot.jpeg?tl_px=0,51\&br_px=1376,820\&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=354,276)

### Click the "Generate Data Source SQL" button in the sidebar

![](https://ajeuwbhvhr.cloudimg.io/https://colony-recorder.s3.amazonaws.com/files/2025-12-02/d82a1818-e01d-4db0-a737-32a96f803d78/ascreenshot.jpeg?tl_px=0,189\&br_px=1376,959\&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=103,348)

### Wait for the SQL to be generated

This process can take a few seconds to a few minutes depending on the complexity of your data source.

![](https://ajeuwbhvhr.cloudimg.io/https://colony-recorder.s3.amazonaws.com/files/2025-12-02/cf60d292-3861-481d-9216-ec5262a25468/ascreenshot.jpeg?tl_px=0,0\&br_px=1376,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=339,137)

### Ensure the SQL statements generate successfully

![](https://ajeuwbhvhr.cloudimg.io/https://colony-recorder.s3.amazonaws.com/files/2025-12-02/30c5de0d-d160-4762-9922-b162188e130e/ascreenshot.jpeg?tl_px=148,0\&br_px=1524,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,143)
