I have
cursor.execute("select RM_ID FROM Sales.dbo.MARKETING where VERSION = 'SomeVersion'")
which gives me a trace error:
pyodbc.ProgrammingError: ('42S02', "[42S02] [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'Sales.dbo.MARKETING'. (208) (SQLExecDirectW)")
I have a few other lines of code:
cursor.execute("select RUNDATEEST FROM Sales.dbo.MARKETING where VERSION = 'SomeVersion'")
which are exactly the same, with the exception of the column name, which give me no error. I'm not sure what my mistake is.
Note:
- I already checked the table for the column name to make sure it exists.
- I noticed that this column is the key for this table. Perhaps keys require a different syntax?
- When I execute a query in SQL Server, it works fine.
source
share