February 27, 2003 at 6:53 am
I need to write a function, here's why:
I am writing a sproc to return a result set back to a report.
I need to indicate in a result set that a particular entity has "pending" transactions (there could be many transactions attached to this row). The user will pass the following parameters: @HeadID, @FromDate and @ToDate. The transactions need to fall within the parameters passed.
The identifying entity will be NameID. And NameID has several records in the Transaction table. I want to bring back the NameID that has records in that table, and join them on NameID with my result set by saying if NameID exists in that Table (returned by the function) THEN 1 or TRUE. Can anyone help? Am I on the right track with this? Open to suggestions. Also, if anyone has any examples, that would be great.
February 27, 2003 at 7:58 am
Can you post some basic create (DDL - Data Definition Language) statements on the objects you are using? While your idea looks clear, it'll help with the code. Also, it sounds like you'll be using a table-valued function which of course in my mind raises the question can you do this without a function? Are you going to re-use what the function will do elsewhere?
K. Brian Kelley
http://www.truthsolutions.com/
Author: Start to Finish Guide to SQL Server Performance Monitoring
http://www.netimpress.com/shop/product.asp?ProductID=NI-SQL1
K. Brian Kelley
@kbriankelley
February 27, 2003 at 3:21 pm
Aside from the psuedo Code, I have nothing yet. I will reuse this function over and over again. So I think the table valued function is the way to go.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply