Thursday, March 8, 2012

Call udf returning a table variable from a stored proc.

Hi,
I have a udf that returns a table variable. I would like to call this from
a stored procedure using the returned table variable in the select statement
of a cursor.
Kind of like this, this is the stored proc where udfProductionsScheduleWork
is the udf - the udf returns a table variable.
declare @.ext int
declare bigcurs CURSOR for
select wrkschedExtruder from dbo.udfProductionScheduleWork
open bigcurs
fetch bigcurs into @.ext
close bigcurs
deallocate bigcurs
RETURN
I can run the udf by itself and it returns rows.
When I run the above stored proc, I get : "Invalid object name
'dbo.udfProductionScheduleWork'.
Any Thoughts?
SteveYou'll need open and close brackets at the end of the function call
select wrkschedExtruder from dbo.udfProductionScheduleWork()|||Geeze, Thank you very much!
Of course that fixed it.
Steve
"markc600@.hotmail.com" wrote:

> You'll need open and close brackets at the end of the function call
> select wrkschedExtruder from dbo.udfProductionScheduleWork()
>

No comments:

Post a Comment