• To concatenate multiple rows into one row, with one example result (for use with sys.master_files) being

    MOVE 'MyDataFileLogicalName' TO 'C:\ThisNewFolder\MyNewFile.mdf', MOVE 'MyLogFileLogicalName' TO 'C:\ThisOtherNewFolder\MyNewLogFile.ldf'

    search for "for xml path stuff concatenate"