I've taken the attitude that I should be as dispassionate as possible to the work I do. Which doesn't mean don't care about the work I do, but there's a point where I become a perfectionist over the projects I truly care about.
It was actually one of my managers who told me to get some perspective about it, it was very hard for me to realize that my work ultimately doesn't define me.