【发布时间】:2015-07-26 11:01:49
【问题描述】:
我有一个表被传递到存储过程中。现在我想使用'select * into #b from openrowset 将存储过程结果插入临时表#b。我的sql代码如下:
create type add1 as table
(score int)
alter proc qwe123
@table add1 readonly
as
begin
select score,score + 2 as cal
from @table
end
go
declare @t add1
insert into @t
select score
from abc
select * into #b from
openrowset('sqlncli','server=localhost;trusted_connection=yes','exec qwe123 @t')
谁能告诉我为什么会出现错误:
链接服务器“(null)”的 OLE DB 提供程序“SQLNCLI10”返回消息“延迟准备无法完成。”。
消息 8180,第 16 级,状态 1,第 1 行
无法准备声明。
消息 137,第 15 级,状态 2,第 1 行
必须声明标量变量“@t”。
【问题讨论】:
标签: sql-server-2008