TSQL Function in Execute SQL Task

Hello,

I'm trying to call a simple TSQL Function I wrote from the Execute SQL Task.  I seem to be able to call the function ok but I can't figure out how to get my result set back.  I'm just returning a boolean value from the function, but it gives me an error when I try to say this will return a result set.  I just use the "Single Row" option as I only have that single value returned.  I know that when you try to use a Stored Procedure and return a result set you have to have the Result Name specified exactly as it's returned from the SP, but a Function doesn't really have a Name returned, right

Any idea how a TSQL Function works from SSIS

Thanks,

Andy



Answer this question

TSQL Function in Execute SQL Task

  • Oscar_Ruiz

    Andy,

    You're correct that a function doesn't have Result Name, but you can give it one.  For example:  select yourdb.yourowner.yourfunction() as YourFunction.  Now you know that the Result Name is "YourFunction" which is enough to save the result to a variable.

    Hope this helps,
    Patrik



  • donno20

    You know, I thought of that, but couldn't seem to get it to work.  But after your reply, I fiddled with it a bit more and was able to get it to work using "As".  All set now.

    Thanks for your help.

    Andy


  • TSQL Function in Execute SQL Task