How to pass table variable into SQL UDF

  • Hi all,

    i need to pass table variable as argument into UDF and,then UDF return another table variable like as follows,

    CREATE FUNCTION(@tempData table)

    RETURNS table

    AS

    BEGIN

    RETURN

    .

    .

    .

    .

    SELECT name,age,FROM Student Where Student_ID in (select Student_ID from @tempData )

    END

    i was try to do that but i could'nt do .please tell me how i do this.

    Thanks,

    Harsha

  • on;y SQL 20l08 has a table variabe as a parameter for an option.

    in 2000 you'll need to do all the work in a single udf instead of 2 udfs.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

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

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