changed .sql querys for a better cross-server-support