Wednesday, March 7, 2012

function call with table as parameter

Hi all, I want to use a function with a tabel object as parameter. Does
someone know a method to do this. I have read that a table as parameter
is invalid.Tables are accessible to functions as well as to calling code so it
shouldn't be necessary to pass them as parameters. It sounds like you
are trying to abstract some logic in a function that might be better
done some other way.

Please explain more fully the problem you are having.

--
David Portas
SQL Server MVP
--|||I should have said that PERMANENT tables are accessible to functions as
well as to calling code. Temporary tables are not. Are you trying to
access a temporary table within a function? If so, consider using an SP
instead.

--
David Portas
SQL Server MVP
--|||I am writing a SP and my idea was to call a function that does some
substitutions at a template-text. The substitution values and original
values should be posted by a dynamic generated table at the SP.

But perhaps it is realy the best way to do the substitutions direct
inside the SP.|||Thomas (Thomas.Martin@.eu.necel.com) writes:
> Hi all, I want to use a function with a tabel object as parameter. Does
> someone know a method to do this. I have read that a table as parameter
> is invalid.

This article of mine may give you some inspiration:
http://www.sommarskog.se/share_data.html.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp

No comments:

Post a Comment