Sql 将完成的过程中的数据插入表中

Sql 将完成的过程中的数据插入表中,sql,sql-server,Sql,Sql Server,如何将已完成过程中的数据插入表中,该过程是使用其他脚本创建的(数据位于结果中的行上)。这是因为我必须连接坐标 完成步骤之一是: select concat ('insert into table_shop ([IU], [ODD]) values ', data1)as PasteDat from #tmp_07 在值data1中,我上传了数据 当完成脚本时,我得到了很多行。 例如: insert into table_shop ([IU], [ODD]) values ('A0001', '

如何将已完成过程中的数据插入表中,该过程是使用其他脚本创建的(数据位于结果中的行上)。这是因为我必须连接坐标

完成步骤之一是:

select concat ('insert into table_shop ([IU], [ODD]) values ', data1)as PasteDat
from #tmp_07
在值data1中,我上传了数据

当完成脚本时,我得到了很多行。 例如:

insert into table_shop ([IU], [ODD]) values ('A0001', 'D08')
insert into table_shop ([IU], [ODD]) values ('Agw44', 'D10')
insert into table_shop ([IU], [ODD]) values ('A5888', 'D18')
.
.
.
现在我要做的是复制行并粘贴到另一个新查询上。有没有更优雅的方法来批量生产呢?

希望这能有所帮助

Use AdventureWorks2012

GO
Create Table #temp --table into which we need to insert
(
[DepartmentID] int,
[Name] varchar(50)
)
GO
Create PROCEDURE SP_ResultSet --SP which returns a result set
as
Select  [DepartmentID]
        ,[Name]
from [HumanResources].[Department]
GO
Insert into #temp EXEC SP_ResultSet -- serves the purpose
GO
Select * from #temp order by [DepartmentID]

我补充了更多的信息。够了吗?您具体想象了什么?不起作用,因为我需要在语句中使用INSERT。