No you can not reset errors memory by disconnecting the battery.
You need to use a diagnosis tool to reset the memory.
Some cars have also a hidden menu which can be activated using odeometer button, and you can reset the errors with that menus
Remeber to buy a proper diagnosis tool since some just reset the engine and transmission errors(obd2 elm327 compliant) but some can interact with other computers in your car and have them reseted as well.
Do a complete research and find a good one, it needs a comprehensive research over the reviews in related forums, I personally bought an interface that didn't work and many people has been alerting to not buying such a cables, but I did not search the internet to read peoples opponion about them, do not trust the reviews on ebays and amazon, just forums and oponions from old members not the new fake ones.
And remember, car computers usually does diagnosis periodically, so if you just reset the error memory without fixing the issue, expect that errors to come back again in two or three days normally, Cause the modern cars do this once in each certain period, some do the test when you disconnect and connect the battery again. So you will not have a lot of time to pass the test.
However I strongly recommend you to fix the issue and have the error memory reseted afterward. Most of the times you need a diagnosis tools to reset the error you just fixed its issue, otherwise it will stay! The car computers usually just add the errors and not erasing them automatically when it is getting fixed, though it also depends on the severity of the error.
For example :
A light error(i.e left rear indicator bulb not working) maybe disapears after changing the bulb but an airbag fault will not be gone after fixing the airbag.