Hi All, Is there a way to access values return from a tablevalued function? Sample code:
Need to call above function from stored procedure as follows;
Is this possible in SQL 2005? Thanks in advance.
(comments are locked)

You should be able to do it like this:
That assumes your function only returns one row of course.
(comments are locked)

Declare @NewValue1 INT, @NewValue2 INT
Above query works well if your function returns only one row, it will not be accurate if your function returns more than one row. In that case you should put your result to a temp table and process each rows using while loop as shown below.
(comments are locked)

Many thanks for your reply.
If you found one of the answers useful, please return the favor by accepting one of them as the answer. This will also help out future users.