<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Parametrize the DLT pipeline for dynamic loading of many tables in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/parametrize-the-dlt-pipeline-for-dynamic-loading-of-many-tables/m-p/153010#M53912</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/103795"&gt;@databrciks&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;You can use pipeline parameters. Below you'll find some examples:&lt;/P&gt;&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/azure/databricks/ldp/parameters#reference-parameters" target="_blank"&gt;Use parameters with pipelines - Azure Databricks | Microsoft Learn&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 02 Apr 2026 09:21:29 GMT</pubDate>
    <dc:creator>szymon_dybczak</dc:creator>
    <dc:date>2026-04-02T09:21:29Z</dc:date>
    <item>
      <title>Parametrize the DLT pipeline for dynamic loading of many tables</title>
      <link>https://community.databricks.com/t5/data-engineering/parametrize-the-dlt-pipeline-for-dynamic-loading-of-many-tables/m-p/152965#M53907</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I need to load many tables into Bronze layer connecting to sql server DB. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;How can i pass the tables names dynamically in DLT. Means one code pass many tables and load into bronze layer&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Apr 2026 20:34:01 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/parametrize-the-dlt-pipeline-for-dynamic-loading-of-many-tables/m-p/152965#M53907</guid>
      <dc:creator>databrciks</dc:creator>
      <dc:date>2026-04-01T20:34:01Z</dc:date>
    </item>
    <item>
      <title>Re: Parametrize the DLT pipeline for dynamic loading of many tables</title>
      <link>https://community.databricks.com/t5/data-engineering/parametrize-the-dlt-pipeline-for-dynamic-loading-of-many-tables/m-p/153010#M53912</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/103795"&gt;@databrciks&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;You can use pipeline parameters. Below you'll find some examples:&lt;/P&gt;&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/azure/databricks/ldp/parameters#reference-parameters" target="_blank"&gt;Use parameters with pipelines - Azure Databricks | Microsoft Learn&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Apr 2026 09:21:29 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/parametrize-the-dlt-pipeline-for-dynamic-loading-of-many-tables/m-p/153010#M53912</guid>
      <dc:creator>szymon_dybczak</dc:creator>
      <dc:date>2026-04-02T09:21:29Z</dc:date>
    </item>
    <item>
      <title>Re: Parametrize the DLT pipeline for dynamic loading of many tables</title>
      <link>https://community.databricks.com/t5/data-engineering/parametrize-the-dlt-pipeline-for-dynamic-loading-of-many-tables/m-p/153050#M53917</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/103795"&gt;@databrciks&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;To make sure I've understood your query... Am I right in saying you want to ingest many SQL Server tables into a Bronze layer using DLT with a single reusable pipeline, where table names are passed dynamically rather than writing separate code for each table?&lt;/P&gt;
&lt;P&gt;If so, I would recommend using a&amp;nbsp;metadata-driven DLT pattern... You can&amp;nbsp;put the list of SQL Server tables in pipeline configuration, then loop over that list in your DLT notebook and define one table per entry via a factory function:&lt;/P&gt;
&lt;P&gt;Here is a sample..&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="l8rrz21 _1ibi0s3do" data-ui-element="code-block-container"&gt;
&lt;PRE&gt;&lt;CODE class="markdown-code-python p8i6j0e hljs language-python _12n1b832"&gt;&lt;SPAN class="hljs-keyword"&gt;import&lt;/SPAN&gt; dlt
&lt;SPAN class="hljs-keyword"&gt;from&lt;/SPAN&gt; pyspark.sql &lt;SPAN class="hljs-keyword"&gt;import&lt;/SPAN&gt; functions &lt;SPAN class="hljs-keyword"&gt;as&lt;/SPAN&gt; F

jdbc_url = spark.conf.get(&lt;SPAN class="hljs-string"&gt;"pipeline.jdbc_url"&lt;/SPAN&gt;)
user = dbutils.secrets.get(&lt;SPAN class="hljs-string"&gt;"sqlserver-scope"&lt;/SPAN&gt;, &lt;SPAN class="hljs-string"&gt;"user"&lt;/SPAN&gt;)
password = dbutils.secrets.get(&lt;SPAN class="hljs-string"&gt;"sqlserver-scope"&lt;/SPAN&gt;, &lt;SPAN class="hljs-string"&gt;"password"&lt;/SPAN&gt;)

connection_props = {
    &lt;SPAN class="hljs-string"&gt;"user"&lt;/SPAN&gt;: user,
    &lt;SPAN class="hljs-string"&gt;"password"&lt;/SPAN&gt;: password,
    &lt;SPAN class="hljs-string"&gt;"driver"&lt;/SPAN&gt;: &lt;SPAN class="hljs-string"&gt;"com.microsoft.sqlserver.jdbc.SQLServerDriver"&lt;/SPAN&gt;
}

SOURCE_TABLES = [
    t.strip()
    &lt;SPAN class="hljs-keyword"&gt;for&lt;/SPAN&gt; t &lt;SPAN class="hljs-keyword"&gt;in&lt;/SPAN&gt; spark.conf.get(&lt;SPAN class="hljs-string"&gt;"pipeline.source_tables"&lt;/SPAN&gt;).split(&lt;SPAN class="hljs-string"&gt;","&lt;/SPAN&gt;)
    &lt;SPAN class="hljs-keyword"&gt;if&lt;/SPAN&gt; t.strip()
]

&lt;SPAN class="hljs-keyword"&gt;def&lt;/SPAN&gt; &lt;SPAN class="hljs-title function_"&gt;make_bronze_table&lt;/SPAN&gt;(&lt;SPAN class="hljs-params"&gt;src_table: &lt;SPAN class="hljs-built_in"&gt;str&lt;/SPAN&gt;&lt;/SPAN&gt;):
    table_name = src_table.replace(&lt;SPAN class="hljs-string"&gt;"."&lt;/SPAN&gt;, &lt;SPAN class="hljs-string"&gt;"_"&lt;/SPAN&gt;).lower()   &lt;SPAN class="hljs-comment"&gt;# dbo.Customers -&amp;gt; dbo_customers&lt;/SPAN&gt;

&lt;SPAN class="hljs-meta"&gt;    @dlt.table(&lt;SPAN class="hljs-params"&gt;
        name=&lt;SPAN class="hljs-string"&gt;f"br_&lt;SPAN class="hljs-subst"&gt;{table_name}&lt;/SPAN&gt;"&lt;/SPAN&gt;,
        comment=&lt;SPAN class="hljs-string"&gt;f"Bronze copy of &lt;SPAN class="hljs-subst"&gt;{src_table}&lt;/SPAN&gt; from SQL Server"&lt;/SPAN&gt;
    &lt;/SPAN&gt;)&lt;/SPAN&gt;
    &lt;SPAN class="hljs-keyword"&gt;def&lt;/SPAN&gt; &lt;SPAN class="hljs-title function_"&gt;_bronze&lt;/SPAN&gt;():
        &lt;SPAN class="hljs-keyword"&gt;return&lt;/SPAN&gt; (
            spark.read.&lt;SPAN class="hljs-built_in"&gt;format&lt;/SPAN&gt;(&lt;SPAN class="hljs-string"&gt;"jdbc"&lt;/SPAN&gt;)
            .option(&lt;SPAN class="hljs-string"&gt;"url"&lt;/SPAN&gt;, jdbc_url)
            .option(&lt;SPAN class="hljs-string"&gt;"dbtable"&lt;/SPAN&gt;, src_table)
            .options(**connection_props)
            .load()
            .withColumn(&lt;SPAN class="hljs-string"&gt;"_ingest_ts"&lt;/SPAN&gt;, F.current_timestamp())
        )

&lt;SPAN class="hljs-keyword"&gt;for&lt;/SPAN&gt; t &lt;SPAN class="hljs-keyword"&gt;in&lt;/SPAN&gt; SOURCE_TABLES:
    make_bronze_table(t)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;DIV class="l8rrz23 _1ibi0s3d7 _1ibi0s332 _1ibi0s3dp _1ibi0s3bm _1ibi0s3ce"&gt;
&lt;DIV class="lqznwq0"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P class="p8i6j01 paragraph"&gt;In the pipeline config you then set, for example:&lt;/P&gt;
&lt;DIV class="l8rrz21 _1ibi0s3do" data-ui-element="code-block-container"&gt;
&lt;PRE&gt;&lt;CODE class="markdown-code-json p8i6j0e hljs language-json _12n1b832"&gt;&lt;SPAN class="hljs-punctuation"&gt;{&lt;/SPAN&gt;
  &lt;SPAN class="hljs-attr"&gt;"configuration"&lt;/SPAN&gt;&lt;SPAN class="hljs-punctuation"&gt;:&lt;/SPAN&gt; &lt;SPAN class="hljs-punctuation"&gt;{&lt;/SPAN&gt;
    &lt;SPAN class="hljs-attr"&gt;"pipeline.jdbc_url"&lt;/SPAN&gt;&lt;SPAN class="hljs-punctuation"&gt;:&lt;/SPAN&gt; &lt;SPAN class="hljs-string"&gt;"jdbc:sqlserver://&amp;lt;server&amp;gt;:1433;databaseName=&amp;lt;db&amp;gt;"&lt;/SPAN&gt;&lt;SPAN class="hljs-punctuation"&gt;,&lt;/SPAN&gt;
    &lt;SPAN class="hljs-attr"&gt;"pipeline.source_tables"&lt;/SPAN&gt;&lt;SPAN class="hljs-punctuation"&gt;:&lt;/SPAN&gt; &lt;SPAN class="hljs-string"&gt;"dbo.Customers,dbo.Orders,dbo.Products"&lt;/SPAN&gt;
  &lt;SPAN class="hljs-punctuation"&gt;}&lt;/SPAN&gt;
&lt;SPAN class="hljs-punctuation"&gt;}&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;DIV class="l8rrz23 _1ibi0s3d7 _1ibi0s332 _1ibi0s3dp _1ibi0s3bm _1ibi0s3ce"&gt;
&lt;DIV class="lqznwq0"&gt;&lt;SPAN&gt;One DLT pipeline will then generate and load all Bronze tables dynamically.&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="lqznwq0"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="lqznwq0"&gt;&lt;SPAN&gt;Or, were you expecting somethign else?&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="lqznwq0"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="lqznwq0"&gt;
&lt;P class="p1"&gt;&lt;FONT size="2" color="#FF6600"&gt;&lt;STRONG&gt;&lt;I&gt;If this answer resolves your question, could you mark it as “Accept as Solution”? That helps other users quickly find the correct fix.&lt;/I&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;I&gt;&lt;/I&gt;&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 02 Apr 2026 14:22:05 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/parametrize-the-dlt-pipeline-for-dynamic-loading-of-many-tables/m-p/153050#M53917</guid>
      <dc:creator>Ashwin_DSA</dc:creator>
      <dc:date>2026-04-02T14:22:05Z</dc:date>
    </item>
    <item>
      <title>Re: Parametrize the DLT pipeline for dynamic loading of many tables</title>
      <link>https://community.databricks.com/t5/data-engineering/parametrize-the-dlt-pipeline-for-dynamic-loading-of-many-tables/m-p/153061#M53924</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;SPAN&gt;Ashwin&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thanks for the quick response. Yes I want to pass all the tables through config parameter/param file and load that into bronze layer&lt;/P&gt;&lt;P&gt;I will try this approach.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Apr 2026 15:00:21 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/parametrize-the-dlt-pipeline-for-dynamic-loading-of-many-tables/m-p/153061#M53924</guid>
      <dc:creator>databrciks</dc:creator>
      <dc:date>2026-04-02T15:00:21Z</dc:date>
    </item>
  </channel>
</rss>

