actually a meaningful definition of SNR with respect to the ECG is not easy.
One way is described on physionet in the context of noise stress testing. You can have a look at https://physionet.org/physiotools/wag/nst-1.htm in the section "Signal-to-noise ratios".
It depends on which part of the signal you call noise. Lately high frequencies have been cut off for being too hard to resolve, but those experienced in advanced meditation show signs of heightened amplitude in higher frequencies.
[IEEE 2010 2nd International Conference on Industrial Mechatronics and Automation (ICIMA 2010) - Wuhan, China (2010.05.30-2010.05.31)] 2010 The 2nd International Conference on Industrial Mechatronics and Automation - The design of ECG signals dually filtering based on FPGA
The noise can be of various forms depending on signal acquisition. It's properties is a prior probability usually that you must guess. Then, you apply your best trick. One example is to use wavelets with thresholding. You'll find many solutions to various cases : physionet, mathworks, github...
Evaluating the SNR is always next to a reference, so you will need to have one at hand.