SQL Server - what is the query to check the row (when id=5 row except other rows)in a table?

Asked By Giri s on 27-Jun-12 01:34 AM
Jitendra Faye replied to Giri s on 27-Jun-12 01:42 AM
Select * from tablename
where id=5
Chintan Vaghela replied to Giri s on 29-Jun-12 01:24 AM

Hi Frndz,


Functionality:  Data is Blank or Null then Update other wise not



To achieve this task,


Check  Condition using ISNULL


UserName = CASE WHEN ISNULL(UserName ,'') = '' THEN 'abc'


Full Logic     :


UPDATE tblUserDeatil set   

UserName = CASE WHEN ISNULL(UserName,'') = '' THEN 'abc' ELSE username END,

    Email = CASE WHEN ISNULL(Email,'') = '' THEN 'def@ggg.com' ELSE Email END




Hope this helpful!