Sketch allows the user to copy the opponent's last move permanently, therefore replacing Sketch. Sketch cannot be used to copy Selfdestruct, Explosion, Struggle, Transform, or Metronome. If used by a transformed Pokémon, Sketch will fail. If the battle does not allow experience points to be earned (such as link battles or Battle Tower battles), any move learned via Sketch will be forgotten at the end of the battle.
Sketch is not affected by Protect or Detect.
>Sketch can now be used to copy Selfdestruct and Explosion when used in a battle with a Pokémon with the Damp Ability. It can also be used to copy Metronome and Transform, if the move fails to activate due to effects such as sleep. Struggle and Shadow moves cannot be sketched.
Generations IV and V
>Chatter cannot be sketched.
>Sketch can now be used to copy Metronome and Transform, without the need for either move to fail.
Sketch will fail if used against a target protected by Crafty Shield. Sketch is not affected by Spiky Shield.
--Straight from Bulbapedia