I tried your suggestion
sp_attach_single_file_db @dbname = 'SWATraining',
@physname = 'C:\Program Files\Microsoft SQL Server\MSSQL\Data\SWATraining.mdf'
but reason this error
Server: Msg 5172, Level 16, State 15, Line 1
The header for file 'C:\Program Files\Microsoft SQL Server\MSSQL\Data\SWATraining.mdf'...