Hi @Gaus Shaikh
Please locate a similar thread and any potential solutions for such errors in the following discussion-
Thank you!
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
While attaching the databse to the SQL server getting the below error, I want to recover my corrupted database please help me :
error: TITLE: Microsoft SQL Server Management Studio ------------------------------ Failed to retrieve data for this request. (Microsoft.SqlServer.Management.Sdk.Sfc) For help, click: https://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&LinkId=20476 ------------------------------ ADDITIONAL INFORMATION: An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo) ------------------------------ C:\Program Files\Microsoft SQL Server\MSSQL15.RRICMDB\MSSQL\DATA\Munim009.mdf is not a primary database file. (Microsoft SQL Server, Error: 5171) For help, click: https://docs.microsoft.com/sql/relational-databases/errors-events/mssqlserver-5171-database-engine-error ------------------------------ BUTTONS: OK
Hi @Gaus Shaikh
Please locate a similar thread and any potential solutions for such errors in the following discussion-
Thank you!
Hi @Gaus Shaikh,
You may also check this thread for the same issue.
Regards,
Zoe Hui
If the answer is helpful, please click "Accept Answer" and upvote it.
Microsoft SQL Server, Error: 5171
select *
from sys.messages
where message_id = 5171 and language_id = 1033
*=> %.ls is not a primary database file.
As the message says, you try to attach some file which isn't a valid primary database file.