• You need to use the value of the variable @file to create the dynamic statement i.e.

    SET @SQL = "BULK INSERT temp FROM '" + @file1 + "' WITH (FIELDTERMINATOR = ',') "