Home Forums SQL Server 2012 SQL Server 2012 - T-SQL SQL 2012 ERROR - The metadata could not be determined because statement contains dynamic SQL RE: SQL 2012 ERROR - The metadata could not be determined because statement contains dynamic SQL

  • Coincidentally, I had a similar problem just this morning with a sproc that calls msdb.dbo.sp_help_job

    Have a look at http://connect.microsoft.com/SQLServer/feedback/details/737341/sql-server-2012-openrowset-on-msdb-dbo-sp-help-job-throws-error

    In particular, the syntax used in the first workaround. The part of the query of interest to you, I think, is the syntax of the WITH RESULTS SETS where the definition of the columns that are returned by the sproc are explicitly listed.

    Hope this help you