Modiefied original script to call a Stored proc instead