How to update table Dynamically in the procedure...?

  • Hi,

    I have a requirement to pass table name as parameter to a procedure and then based on that the procedure has to update some records in that table.

    Could you please give syntax for the same ?

    Regards

    Ezhilan

  • You have to use dynamic sql. Look for sp_executesql in BOL.

    How many tables are involved in this process? Wouldn't it be better to create separate procedure for each table? I am asking because I don't think personally that such loose interface is good for performance and maintenance of application. Of course, there are cases when it can't be avoided

    Piotr

    ...and your only reply is slàinte mhath

  • Hi,

    Thank you...its working fine..

    Regards,

    Ezhilan

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

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