Updated stored procedure to return a record set.