BEGIN    
 IF EXISTS(SELECT  * FROM Table1 WHERE ID=@ID)      
  BEGIN     
    UPDATE Table1 SET Name=@Name  WHERE ID=@ID    
    SELECT '1'   
  END    
 ELSE     
  SELECT '0'    
END  
Is this the row no. of the table or what ? Also "IF EXISTS" is checking what ? the table or if the ID exists or not ??