Q:

SQL Table Function to variable

I have a SQL Function which returns a table. I am wondering how to take the result table and return it into a temporary table I use (Called @Values in this case). 
Here is an example:
declare @values table(
MinValue money, 
MaxVale money
)

/*
Fill @Values with dbo.GenPayValues function 
*/

Currently I am only able to select from the function like this: 
SELECT * 
FROM dbo.GenPayValues(13.00, 25.00)

Does anyone know if this is possible? Thanks so much for taking the time to read this.

A:

This will work as long as the structures are exactly the same:
INSERT @values
SELECT * 
FROM dbo.GenPayValues(13.00, 25.00)

However, if the structures are different, do this instead:
SELECT *
INTO #values
FROM dbo.GenPayValues(13.00, 25.00)

That will create a temporary table, instead of variable, but it will still be dropped at the end of the scope.

