

In the setup I'm using for the data pipeline simulation, the Microsoft SQL Server is hosted remotely on a Windows Server 2019 Virtual Machine (VM). Before we can access a database in Microsoft SQL Server, we need to configure a Data Source Name (DSN) for the data source (database/server) with the ODBC driver on the native machine hosting the target SQL Server database.

When writing programs that involve interacting with a database, we need to use connection modules or client drivers to establish a database connection in order to send commands and receive responses in the form of a result set.Ĭonnecting to Microsoft SQL Server from a Python program requires the use of ODBC driver as a native data access API. Connect to a remotely-hosted Microsoft SQL Server within a Python script, using SQLAlchemy as a database abstraction toolkit and PyODBC as a connection engine to access the database within the remotely-hosted SQL Server.
