TD Report and edit sql for mssql support