I find my self in a situation where I have to choose between either creating a new sp in database and create the middle layer code. so loose some precious development time. also the procedure is likely to contain some joins.
Or use two already existing sp(s), the problem of this approach is that I am doing two round trips to database. which can be poor performance especially if I have database in another server.
Which approach you will go?, and why?
thanks
You’ve answered the question your self. Two round trips is going to be far less efficient, and should be avoided.
If you don’t have much time, you might be able to create a new SP that calls the other two SPs.
If it’s really slow to create code for calling a new SP, and people are avoiding it, you might want to question your architecture as a whole.