EXEC sp_attach_db @dbname = N'XXXXX_DBName', @filename1 = N'C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\XXXXX_DBName.MDF'
附件没有ldf的数据库