Rewrite query to not use CONCAT function in SQL Server 2008 R2? I know that the CONCAT function does not exist in SQL Server prior to 2012. How would i optimize my code to not use the CONCAT function?

         SELECT  dbname = DB_NAME(),
                  file_name = name, 
                  TotalMB = CONVERT(decimal(12,1),size/128.0),
                  UsedMB = CONVERT(decimal(12,1),FILEPROPERTY(name,'SpaceUsed')/128.0),
                  FreeMB = CONVERT(decimal(12,1),(size - FILEPROPERTY(name,'SpaceUsed'))/128.0),
                  Command = CONCAT('USE MASTER; ALTER DATABASE ', DB_NAME(), '; MODIFY FILE (name = ',
                        [name], ', size = ', 
                        convert(int,round(1.15 * FILEPROPERTY(name,'SpaceUsed')/128,-1)), 'MB)')
           FROM sys.database_files WITH (NOLOCK)
           WHERE type_desc = 'ROWS'
           ORDER BY file_id;
You can concatenate strings in SQL Server just by using the + operator. So to avoid using CONCAT, your code can be rewritten as:

SELECT  dbname = DB_NAME(),
                 file_name = name, 
                 TotalMB = CONVERT(decimal(12,1),size/128.0),
                 UsedMB = CONVERT(decimal(12,1),FILEPROPERTY(name,'SpaceUsed')/128.0),
                 FreeMB = CONVERT(decimal(12,1),(size - FILEPROPERTY(name,'SpaceUsed'))/128.0),
                 Command = 'USE MASTER; ALTER DATABASE ' + DB_NAME() + '; MODIFY FILE (name = ' + 
                    [name] + ', size = ' + convert(int,round(1.15 * FILEPROPERTY(name,'SpaceUsed')/128,-1)) + 'MB)'
FROM sys.database_files WITH (NOLOCK)
WHERE type_desc = 'ROWS'
ORDER BY file_id;