来源:https://bbs.csdn.net/topics/390876072
CREATE PROCEDURE [dbo].[sp_test]
@id INT
AS
BEGIN
SET NOCOUNT ON;
SELECT @id+10
END
CREATE TABLE #tab
(
ID int
)
INSERT INTO #tab
EXEC sp_test 10
SELECT * FROM #tab
DROP TABLE #tab
创建一个临时表#
insert # exec ...
select * into #t from openquery(localserver,'exec p1')