Skip to content

Tag: python

How to call a complex SQL query in python

I have the following SQL code: This SQL code has been tested and runs perfectly on SQL Server Management Studio. Now I have the following code for python which is to communicate with an MS SQL Server instance: When I run it, I get the following error where it points to the first semicolon in my code. Could yo…

Iterating through a list Python SQL

I’m trying to search a database, by iterating through a list of search values. I’m almost there as this works for integers but not strings. The code below won’t work, but if I replace the list values with numbers it does: Answer It’s because you have to enclose strings in quotation mar…