Article usage in two sentences [duplicate]

To have surgery is the grammatical form; to have *a surgery is not grammatical under most circumstances. That’s because the noun surgery is more often used as a mass noun than it is as a count noun.

So you wouldn’t use the indefinite article before it, just like you don’t before peace in “We will have peace in our times.”

It’s more common to say that you’ve had surgery twice than that you’ve had two surgeries. If you need a count noun, we usually use an operation or sometimes a surgical procedure. You’ve had two operations or two surgical procedures.