I am writing my Stored Procedure to update any rows that have changed, by default all the variables in the SP are set to NULL, so what I am doing is..
SET FirstName = ISNULL(@FirstName , FirstName )
, LastName = ISNULL(@LastName , LastName )
, PhoneNumber = ISNULL(@PhoneNumber , PhoneNumber )
WHERE TableID = @TableID
So basically if the user didn't pass in the variables they will be NULL and they will be updated to the same value.
Is this a bad practice? this query will be running constantly to update different values.
View Complete Post