Pinal Dave
Member since Aug 11, 2010
- Profile: /members/6646-pinal-dave.htm
- URL: http://blog.sqlauthority.com
- Comments: 1
Recent Blog Comments By Pinal Dave
-
Using CASE Statements In A SQL UPDATE Query
Posted on Aug 11, 2010 at 10:51 AM
@ABHAY, Ben is absolutely correct. You should use following code. UPDATE SET RTRMNT_FG = ISNULL(TARGET.RTRMNT_FG,SOURCE.RTRMNT_FG) --UPDATE ONLY WHEN ITS NULL , DT_OF_RTRMNT = SOURCE.DT_OF_RTRMNT , UPD_TS = GETDATE()... read more »