Thứ Năm, 5 tháng 6, 2014

Insert Stored Procedure Results Into Table

-- Create a sample stored procedure
CREATE PROCEDURE GetList
AS
BEGIN
SELECT
ListName = 'MyList'
,ListNumber = 1
END
GO

-- this table will house our results
CREATE TABLE #List
(
ListName VARCHAR(25),
ListNumber INT
)

-- finally, execute and insert into our table
INSERT INTO #List
(
ListName,
ListNumber
)
EXEC dbo.GetList

Địa chỉ tham khảo http://sqlserverplanet.com/tsql/insert-stored-procedure-results-into-table

Không có nhận xét nào:

Đăng nhận xét

Lưu ý: Chỉ thành viên của blog này mới được đăng nhận xét.