You are in luck as long as the sp_detach_db was executed properly. If so, use the sp_attach_single_file_db command to attach a database with a single data file (*.mdf). When you use this command, SQL Server will create a log file and attempt to resolve any data related discrepancies. The syntax for this command would be:
USE Tempdb GO EXEC master.dbo.sp_attach_single_file_db @dbname = 'DatabaseName', @physname = 'D:\Program Files\Microsoft SQL Server\MSSQL\Data\DatabaseName.mdf' GOBased on the circumstances, it may be beneficial to ensure that the database does not have any consistency or allocation issues by executing the following commands:
Dig Deeper on Microsoft SQL Server Installation
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.