To continue reading for free, register below or login
To read more you must become a member of SearchSQLServer.com
');
// -->

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 FilesMicrosoft SQL ServerMSSQLDataDatabaseName.mdf'
GO
Based 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:
|