Tail Servo for RC Heli

When you write the code to the servo does it stay on the servo or does the code only work why the servo is connected to the arduino board?

It only works when connected to the Arduino. You do not write code onto the servo.