DateTime Should update if the data is passed else update it with original value which is already saved. This update does not works
DECLARE @FolderStatusDate DATETIME = NULL
SET @FolderStatusDate = '2012-07-04 14:09:04.043'
UPDATE CM.PfmFolder
SET
FolderStatusDate = ISNULL(@FolderStatusDate, FolderStatusDate)
WHERE Id = @Id
ifnullis MySql and is not available in SQL Server@idis neither declared nor set, but the query seems correct. What "does not works" mean? You get an error, the data is not updated when it should, or the opposite, or what else?Tas the separator rather the space, e.g.'2012-07-04T14:09:04.043'-'2012-07-04 14:09:04.043'can be interpreted (under weird circumstances) as eitheryyyy-mm-dd...oryyyy-dd-mm...-) in the date part:20120704 14:09:04.043. It is true that either method makes the original form less readable, but I believe consistency is more important and at least you've got more than one unambiguous format to choose from.