i have a stored proc that does a simple update (see below).
i want to update only fields passed and not the ones that are null. that is to say if i dont get a parm value for somethign i dont want to update the table data to null, but rather just leave what the current value is.
can this be done in a sql update statement such as this?
ALTER PROCEDURE [dbo].[upd_MessageDetail] @MessageId INT, @IsDraft INT, @IsPreviewed INT, @IsRead INT, @IsFlagged INT, @IsDeleted INT, @IsArchived INT AS BEGIN UPDATE MessageDetail SET IsDraft = @IsDraft, IsPreviewed = @IsPreviewed, IsRead = @IsRead, IsFlagged = @IsFlagged, IsDeleted = @IsDeleted, IsArchived = @IsArchived WHERE MessageId = @MessageId