Reputation: 124
By mistake LDF file of my database is deleted. Now i am not able to access that database.
Is there a way which i can access this database ?
Upvotes: 0
Views: 5836
Reputation: 1815
1) Detach corrupted database 2) Attach database using:
CREATE DATABASE [MYDATABASE] ON
( FILENAME = N’D:\Microsoft SQL Server\YourDataPath\Data\Database.mdf’ )
FOR ATTACH_REBUILD_LOG
GO
3) The log file will be created by itself
Upvotes: 2