|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Passing a table into a functionI created a function and passing in a table however, it compains,
Can we pass in a table to a function?? anhting wrong with this? can't see the error thanks Ken CREATE FUNCTION dbo.getLatestDate ( @Original TABLE (Indx INT, ID INT, iDate DATETIME) ) RETURNS @Result TABLE (ID INT, iDate DATETIME) AS BEGIN SQL Ken wrote:
Show quote > I created a function and passing in a table however, it compains, See "CREATE FUNCTION" in Books Online, it tells you exactly what data > > Can we pass in a table to a function?? > > anhting wrong with this? can't see the error > > thanks > > Ken > > CREATE FUNCTION dbo.getLatestDate > ( > @Original TABLE (Indx INT, ID INT, iDate DATETIME) > ) > RETURNS @Result TABLE (ID INT, iDate DATETIME) > AS > BEGIN > types can be used as parameters... Send an xml string to a SP, then in SP dump xml into a temp table.
Show quote "SQL Ken" <SQL***@gmail.com> wrote in message news:1157743960.974305.179820@m79g2000cwm.googlegroups.com... >I created a function and passing in a table however, it compains, > > Can we pass in a table to a function?? > > anhting wrong with this? can't see the error > > thanks > > Ken > > CREATE FUNCTION dbo.getLatestDate > ( > @Original TABLE (Indx INT, ID INT, iDate DATETIME) > ) > RETURNS @Result TABLE (ID INT, iDate DATETIME) > AS > BEGIN > |
|||||||||||||||||||||||