Blog Archives

How to connect Python and SQL Server – Part 2

Hey Guys,

In my first blog post about Python and SQL Server, I gave a very short introduction in how to actually connect and execute a simple query. Today I want to extend a bit on using Python and SQL Server.

As I described in the end of the previous post the ideal scenario is that you inherit the database connection from a single file and then use it whenever and anywhere you want. This makes your code to look cleaner and eliminate redundant work in case you need to change credentials or something else. For that I will show to you how to do it. Read the rest of this entry