Environment and sql