Oracle to sqlserver stored procedure syntax conversion