Skip to content

How to read and write to an Azure SQL database from a Pandas dataframe

Notifications You must be signed in to change notification settings

mkempers/howto-sqlazure-pandas

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

How to read and write to an Azure SQL database from a Pandas dataframe

The code is very basic and self-explanatory. The main code can be found in main.py. Here is what is happening:

  1. The following constants are set:
  • Azure SQL database userid.
  • Azure SQL database password.
  • Azure SQL database server name (fully qualified).
  • Azure SQL database name (if it does not exit, pandas will create it).
  • Azure SQL database table name.
  • ODBC Driver, there are several guides out there on how to set this up on different OS's.
  1. Building the right connectionstring for azure sql and the odbc driver.
  2. Read dummy data from CSV into a dataframe.
  3. Create SQL Alchemy engine and write data to SQL.
  4. Read data from SQL back into a dataframe.

  You should replace the constants with your own values.

About

How to read and write to an Azure SQL database from a Pandas dataframe

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages