making changes for SQL Server compatability