What is Python common practice for stored procedure results [closed]
Solution 1:
That's the difference between using an ORM like sqlalchemy, and using a lower-level API (here pyodbc/pandas). As a middle ground you could create a class to contain all the column names in one place, and minimize the use of "magic strings" in your code.
class SP_Cols:
SP_Col_Name= 'SP_Col_Name'
SP_OtherCol_Name= 'SP_OtherColCol_Name'
Then write
res[SP_Cols.SP_Col_Name]