34,593
社区成员
发帖
与我相关
我的任务
分享
CREATE TABLE #test(colAssetID int not NULL)
INSERT INTO #test
EXEC B_Create 145, 'Name_T', 'Test',2
alter proc B_Create
(
@i int,
@o nvarchar(20),
@p nvarchar(20),
@q int
)
as
begin
EXEC('select 1 union all select 2')
end
CREATE TABLE #test(colAssetID int not NULL)
INSERT into #test
EXEC B_Create 145, 'Name_T', 'Test',2
select * from #test
/*
colAssetID
-----------
1
2
(2 行受影响)
*/
drop table #test
可能是你存储过程的问题如果返回正确是没有问题的
我测试通过
CREATE TABLE kk(a INT ,b DECIMAL(10) ) --
INSERT INTO kk
exec dbo.PROC_StaticNeedMaterial 43493
fldID fldProductCode fldMaterialCode fldNeedQuantity fldLostQuantity
-------------------- --------------- --------------- --------------------------------------- ---------------------------------------
1 P101 15772 10.00000000 2.00000000
3 P102 15772 15.00000000 3.00000000
4 P103 3748 12.00000000 4.00000000
5 P104 48926 13.00000000 2.00000000
6 P105 48926 12.00000000 2.00000000
7 P106 48926 24.00000000 5.00000000
938 43493 10035 10.00000000 0.05000000
939 43493 10042 23.00000000 0.11500000
940 43493 10050 5.00000000 0.05000000
941 43493 10052 1.00000000 0.00500000
(10 row(s) affected)
create proc B_Create
(
@i int,
@o nvarchar(20),
@p nvarchar(20),
@q int
)
as
begin
select 1
end
CREATE TABLE #test(colAssetID int not NULL)
INSERT into #test
EXEC B_Create 145, 'Name_T', 'Test',2
select * from #test
/*
colAssetID
-----------
1
*/
drop table #test
没有问题啊
use dbx
go
create procedure up_t
as
begin
select 1 union all
select 2 union all
select 3 union all
select 4
end
go
create table #t
(
id int primary key identity(1,1)
,c int
)
go
insert into #t exec up_t
select * from #t
drop table #t