Passing column value to UDF

  • Dear All,

    I want to pass a value of column to a User Defined Function which I am using in my query and the value will come from Query based on the result set.

    Actually I am using a function returning table and using it in join with another table so when I pass the column value to it it givs me Incorrect Syntax.

    Waitng for you response.

    Regards

    Anoop Singhal

    Database Administrator

    Advent Matrix Inc.

    http://www.stonematrix.com

  • You can't join on a table function that accept dynamic parameters. Imagine how hard it would be to do that?? Let's say you have 100 rows in the main table that joins to the function, how would sql server handle the 100 consecutive inner joins created by the functions...

    Maybe you can try creating a derived table that will return all the rows you need in one shot and then join that table to the main table.

  • See CREATE FUNCTION in BOL...a table-valued function can only accept a constant or a variable in it's arguments.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply