SET @Name = NULL;
UPDATE emp
SET name="gaurav"
WHERE (@Name IS NULL AND name IS NULL)
OR (@Name IS NOT NULL AND name = @Name)
SET @Name = NULL;
UPDATE emp
SET name="gaurav"
WHERE (@Name IS NULL AND name IS NULL)
OR (@Name IS NOT NULL AND name = @Name)