The execution of the Stored Procedure below results in the following output:
The above is just an output. It is not created in a view or a table.
I would like the output to be stored in a table or view.
I know when you see the Stored Procedure there will be lots of questions as to why I want to do this when I can just reference the TVF directly? Please trust me it just is easier for me to do it this way if possible.
The Stored Procedure is as follows:
CREATE PROC outbound.usp_Terminals(@AsOfDate date)
AS
SELECT
airport_code,
airport_name,
airport_city,
airport_state
FROM
dbo.fnGetAirports(@AsOfDate)
GO
I was thinking the solution would be something like
select ... into... from...
DECLARE @date date
SET @date = ...
INSERT INTO #prebuilt_table
EXEC dbo.outbound.usp_Terminals @date
Hi ScottPletcher,
Thank you very much for reaching.
Please forgive the silly question, but where you mention #prebuilt_table, are you saying that I need to have already created a table to be inserted into?
Hi ScottPletcher,
I tried you suggestion but it didn't work
What does "didn't work" mean? What code did you run? Was there an error? Was there no error, but the results weren't what you expected?
Hi SqlHippo
I rant the following:
CREATE PROC outbound.usp_Terminals(@AsOfDate date)
AS
DECLARE @date date
SET @date = ...
SELECT
airport_code,
airport_name,
airport_city,
airport_state
INSERT INTO #prebuilt_table
EXEC dbo.outbound.usp_Terminals @date
FROM
dbo.fnGetAirports(@AsOfDate)
GO
This actually worked.
Thank you very much ScottPletcher