Unit testing

Made a stored proc and unit tested.