DUMP all DML in a single procedure

  • Dear All,

    I have a question, this can be stupid also. But I want to know the answer for this, as I am not a DBA and not exposed to Database programming. The scenario is as follows:

    Myself and my college had a discussion on writing the stored procedure.

    My friend is saying that he is going to dump all the DML statements (Insert, Update, Delete, Select) in a single procedure and by passing a type the appropriate part of the procedure / DML will be executed.

    But I asked him to have the Insert and Update in a single procedure and two more for select and deleted, such that the procedure will have readability and so on.

    This went to an argument and last we have not finalized anything.

    Now my question is which way is suitable, in my application there are lots ant lots of tables and procedures are already available as it is a product.

    Can any one tell me whether dumping will degrade the performance or lead to any other issue?

    Thanks a lot in advance.

    [font="Arial"]Nothing is impossible with Hard Work[/font]:)

  • Jaya,

    it's always good to keep your object objects isolated. this will help you to keep track. This may possible that in future there will be a change in your Business Logic, keeping the objects isolated helps you to modify the same.

  • Dear Friend,

    Thank you for your reply.

    🙂

    [font="Arial"]Nothing is impossible with Hard Work[/font]:)

  • If you put all your actions in one procedure with if statements you also eliminate the benefit of having a cached execution plan.

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

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