| Author |
function call with table as parameter
|
|
| Thomas 2005-06-27, 7:23 am |
| 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.
| |
| David Portas 2005-06-27, 7:23 am |
| 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
--
| |
| David Portas 2005-06-27, 7:23 am |
| 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
--
| |
| Thomas 2005-06-27, 7:23 am |
| 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.
| |
| Erland Sommarskog 2005-06-27, 8:23 pm |
| 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
|
|
|
|