【发布时间】:2020-01-26 05:00:20
【问题描述】:
我有一个返回这个结果的存储过程:
我调用存储过程的方式是:
Exec uspGetStandardUsingRoleandPhase '1908003'
我想将这些结果存储到一个临时表中,所以我像这样使用insert into:
IF OBJECT_ID(N'tempdb.dbo.#tmp', N'U') IS NOT NULL
DROP TABLE #tmp
CREATE TABLE #tmp
(
startDate DATE,
endDate DATE,
strPhase NVARCHAR(50),
strBadgeNumber NVARCHAR(30)
)
INSERT INTO #tmp (startDate, endDate, strPhase, strBadgeNumber)
EXEC uspGetStandardUsingRoleandPhase '1908003'
但我收到这样的错误:
INSERT EXEC 失败,因为存储过程更改了目标表的架构。
【问题讨论】:
-
嗯,你有错误:) 现在你只需要找到在你的 SP 中修改模式的东西。没有 SP 代码,我们无能为力。
标签: sql sql-server stored-procedures temp-tables