There are different ways of doing this and complying with the Code.
1. From the sprinkler system (within 5 foot of entry*) take the wire to the service.
2. From the sprinkler (within...*) take the wire to the GEC and use an irreversable crimp, not a split bolt.
3. From the sprinkler take the wire to the water pipe and use a pipe clamp.
4. If you have building steel go from the service to the steel. Then you can take the water to the steel and the sprinkler to the steel.
The last method saves alot of copper.
If it was easy, anyone could do it.