• If I understand you here, you want to update a single row in a table, but you only want to change certain fields, and the fields that you want to change can be different each time?

    Here is a (inefficient and horrible) way to achieve this. Basically you pass in the ID of the row to be updated (or whatever you need to get it) and the update stored procedure takes ALL of the fields that can be updated as optional parameters.

    CREATE PROCEDURE testUpdate @intID as int,

    @intCol1 as int=null,

    @intCol2 as int=null

    AS

    IF @intCol1 is not null UPDATE tableb SET col1=@intCol1 WHERE ID=@intID

    IF @intCol2 is not null UPDATE tableb SET col2=@intCol2 WHERE ID=@intID

    ... repeat for each updatable field ...

    So:

    testUpdate @intID=1, @col1=1 just changes col1

    testUpdate @intID=1, @col2=1 just changes col2

    testUpdate @intID=1, @col1=1, @col2=1 changes both col1 and col2.