SQL Server reports ‘Invalid column name’, but the column is present and the query works through management studio
I suspect that you have two tables with the same name. One is owned by the schema ‘dbo’ (dbo.PerfDiag), and the other is owned by the default schema of the account used to connect to SQL Server (something like userid.PerfDiag). When you have an unqualified reference to a schema object (such as a table) — one … Read more