Pain in the upper back or just pain in the back can happen during a heart attack but if you're not experiencing any other heart attack symptoms such as chest pain, chest tightness, arm numbness, jaw pain, shortness of breath and even nausea then it's most likely just back pain that you're experiencing in your upper back.
Sweating is also a symptom of a heart attack and if you do believe you or someone may be having a heart attack then you should call 911 immediately.
It's better to get an ambulance out to check you out and not be having a heart attack then it is to wait and have a heart attack and not be able to call 911 and get help.