无法确定元数据,因为每个代码路径都会导致错误;查看其中一些以前的错误
The metadata could not be determined because every code path results in an error; see previous errors for some of these
我正在从 SQL Server 2005 迁移到 SQL Server 2014,其中一个查询在 SQL Server 2014 中停止工作:
select *
from openrowset ('SQLOLEDB','Server=(local);TRUSTED_CONNECTION=YES;',' exec [MyDatabase].[dbo].[MyTable]')
我收到以下错误消息:
Msg 11529, Level 16, State 1, Procedure sp_describe_first_result_set,
Line 1
The metadata could not be determined because every code path results in an error; see previous errors for some of these.
Msg 4902, Level 16, State 1, Procedure sp_describe_first_result_set, Line 1
Cannot find the object "#MyTempTable" because it does not exist or you
do not have permissions.
dbo.MyTable
和#MyTempTable
不是真实姓名。
什么可能导致此错误?任何帮助将不胜感激。
谢谢
从SQL Server 2012开始,需要使用WITH RESULT SETS
明确描述结果集:
EXEC('exec [MyDatabase].[dbo].[StoredProcedure] WITH RESULT SETS (( val SMALLINT));')
我正在从 SQL Server 2005 迁移到 SQL Server 2014,其中一个查询在 SQL Server 2014 中停止工作:
select *
from openrowset ('SQLOLEDB','Server=(local);TRUSTED_CONNECTION=YES;',' exec [MyDatabase].[dbo].[MyTable]')
我收到以下错误消息:
Msg 11529, Level 16, State 1, Procedure sp_describe_first_result_set, Line 1
The metadata could not be determined because every code path results in an error; see previous errors for some of these.Msg 4902, Level 16, State 1, Procedure sp_describe_first_result_set, Line 1
Cannot find the object "#MyTempTable" because it does not exist or you do not have permissions.
dbo.MyTable
和#MyTempTable
不是真实姓名。
什么可能导致此错误?任何帮助将不胜感激。
谢谢
从SQL Server 2012开始,需要使用WITH RESULT SETS
明确描述结果集:
EXEC('exec [MyDatabase].[dbo].[StoredProcedure] WITH RESULT SETS (( val SMALLINT));')