allorhinaMemberSeptember 15, 2015 at 8:12 am #165758
Afternoon All MSSQL Experts
We run a MRP package called PREDCOM that uses MSSQL as a db. Since of this morning we cannot start the db service. The error message indicates that the master.mdf file is corrupt. Can anybody assist us to restore the database without losing the table definitions, stored procedures and data.
OssianModeratorSeptember 15, 2015 at 8:31 am #190879
This is the main file for the Master database that controls all of SQL server. If it is corrupt, the best solution is to restore from backup. Failing that, you can create a new master database and re-attach other existing databases, so not losing data but probably losing security settings, logins etc.
If you tell us which version of SQL server you are using, I will pull out some references, otherwise :google: for SQL Server lost master database or similar will get you to the right place: https://www.google.co.uk/search?q=SQ…gBw&gws_rd=ssl
If you don’t have backups of the master database, I strongly suggest you review your backup policy once you have recovered
StevDoMemberSeptember 22, 2015 at 10:15 am #391174
One of the methods for restoring sql database via T-SQL, if guide below can’t help you, take a look at more powerful methods
[MOD EDIT DODGY LINKS DELETED]
Restore With Transact-SQL
Click “New Query” in the Management Studio’s main toolbar. This opens a large text area on the right side of the screen.
Click in the text area and type a Create Database statement using the following Transact-SQL code as a guide:
CREATE DATABASE MyDatabase ON (FILENAME = ‘c:data filesmy_data.mdf’), (FILENAME = ‘ c:data filesmy_data.ldf’) FOR ATTACH;
Click the “Execute” button in the Transact-SQL toolbar, located just under the Management Studio’s main toolbar. The Execute button symbol is a right-pointing triangle. SQL Server Management Studio restores the database.
OssianModeratorSeptember 22, 2015 at 10:27 am #190910
If you took the trouble to read the original post, you would see that the OP cannot start SSMS without the master database, so your post is useless.
I suspect spam and am removing the links you posted.
vegas588MemberMay 5, 2016 at 2:49 pm #391354
When you can’t restore .sql data via standard solutions make use of guide below or if even the guide can’t help you, it might be that your sql data was severely corrupted and you may get more powerful tips on
[MOD EDIT – commercial link deleted and spammer banned]
You must be logged in to reply to this topic.