Updated SQL Script