Some misc work on the mssql script