December 5, 2002 at 6:44 am
Does exists what kind of trick to pass table variable to UDF?
For example:
declare @var table (x int)
insert into @var select something from somewhere
select dbo.myUDF(@var)
Or it is possible to pass select statement as parameter?
Toni.
December 5, 2002 at 7:05 am
Currently UDFs are limited to scalar parameters (ie, your plain vanilla data types). If you want to pass a statement, I would wonder why? Usually you just want to pass parameters in and use them in your already coded and tested statement.
I doubt you can create a function that does what you want. SQL Server 2000 functions are still in their infancy and limited in what they can do.
December 5, 2002 at 4:43 pm
I believe thou you can create a temp table instead liek
CREATE TABLE #var (x int)
and use a reference inside the UDF to #var. As long as in the same scope the table is visible to the UDF. But the question is what do you need to do exactly as you may be practicing overkill here.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply