<?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: Lakehouse - Creating stored procs using Notebooks in Data Engineering</title>
    <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Lakehouse-Creating-stored-procs-using-Notebooks/m-p/4088030#M3483</link>
    <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/787733"&gt;@Soobramoney&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Perhaps you can use the pyodbc to connect to the data source and execute the create SP command:&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;import pyodbc

# copy and paste the SQL endpoint from any of the Lakehouses or Warehouses in your Fabric Workspace          
server = "your endpoint"
# copy and paste the name of the Lakehouse or Warehouse you want to connect to
database="YourDatabase"

# use Service principal to connect
clientId = ""
clientSecret = mssparkutils.credentials.getSecret("https://YourKeyVault.vault.azure.net/","your-client-secret-secret-name")

constr = f"driver=ODBC Driver 18 for SQL Server;server={server};database={database};UID={clientId};PWD={clientSecret};Authentication=ActiveDirectoryServicePrincipal;Encrypt=yes;Timeout=60;"

con = pyodbc.connect(constr)

cursor = con.cursor()

create_SP_Command=""

result=cursor.execute(create_SP_Command)

print(result)

cursor.close()
con.close()&lt;/LI-CODE&gt;
&lt;P&gt;&lt;A href="https://stackoverflow.com/questions/78285603/load-data-to-ms-fabric-warehouse-from-notebook" target="_blank"&gt;Load data to MS Fabric Warehouse from notebook - Stack Overflow&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Xiaoxin Sheng&lt;/P&gt;</description>
    <pubDate>Thu, 08 Aug 2024 02:00:18 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-08-08T02:00:18Z</dc:date>
    <item>
      <title>Lakehouse - Creating stored procs using Notebooks</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Lakehouse-Creating-stored-procs-using-Notebooks/m-p/4086878#M3470</link>
      <description>&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it possible to create a stored proc on Fabric lakehouse from a notebook?&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 14:02:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Lakehouse-Creating-stored-procs-using-Notebooks/m-p/4086878#M3470</guid>
      <dc:creator>Soobramoney</dc:creator>
      <dc:date>2024-08-07T14:02:21Z</dc:date>
    </item>
    <item>
      <title>Re: Lakehouse - Creating stored procs using Notebooks</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Lakehouse-Creating-stored-procs-using-Notebooks/m-p/4088030#M3483</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/787733"&gt;@Soobramoney&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Perhaps you can use the pyodbc to connect to the data source and execute the create SP command:&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;import pyodbc

# copy and paste the SQL endpoint from any of the Lakehouses or Warehouses in your Fabric Workspace          
server = "your endpoint"
# copy and paste the name of the Lakehouse or Warehouse you want to connect to
database="YourDatabase"

# use Service principal to connect
clientId = ""
clientSecret = mssparkutils.credentials.getSecret("https://YourKeyVault.vault.azure.net/","your-client-secret-secret-name")

constr = f"driver=ODBC Driver 18 for SQL Server;server={server};database={database};UID={clientId};PWD={clientSecret};Authentication=ActiveDirectoryServicePrincipal;Encrypt=yes;Timeout=60;"

con = pyodbc.connect(constr)

cursor = con.cursor()

create_SP_Command=""

result=cursor.execute(create_SP_Command)

print(result)

cursor.close()
con.close()&lt;/LI-CODE&gt;
&lt;P&gt;&lt;A href="https://stackoverflow.com/questions/78285603/load-data-to-ms-fabric-warehouse-from-notebook" target="_blank"&gt;Load data to MS Fabric Warehouse from notebook - Stack Overflow&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Xiaoxin Sheng&lt;/P&gt;</description>
      <pubDate>Thu, 08 Aug 2024 02:00:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Lakehouse-Creating-stored-procs-using-Notebooks/m-p/4088030#M3483</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-08-08T02:00:18Z</dc:date>
    </item>
  </channel>
</rss>

