I have a query that is dynamically built after looking up a field list and table name. I execute this dynamic query inside a stored proc. The query is built without a where clause when the two proc parameters are zero, and built with a where clause when not.
When I execute the proc with SET FMTONLY ON exec [cpExportRecordType_ListByExportAgentID] null, null It returns no column information. I have just now replaced building the query without a where clause to just executing the same query directly, and now I get column information. I would love to know what causes this, anyone?