MS SQL Error 945 occurs due to lack of storage space, corrupt backup file, improper shutdown of the database, etc.
Here at Bobcares, we help webmasters and server owners resolve MS SQL errors such as this as part of our Server Management Services.
Today, we’ll go through the top causes for this error, and how we fix them.
What are the causes for MS SQL Error 945?
Some of the causes for MS SQL Error 945 are:
- Improper shutdown of the database
- Using corrupt backup file.
- Failed SQL database repair.
- Lack of storage space.
Now, let’s see how we fix it.
How to fix MS SQL Error 945
We have many ways for fixing MS SQL error 945. Let’s see some of them in detail.
Increase hard drive space
One of the reasons for SQL error 945 is disk space issue. Inorder to increase the space, either we remove unnecessary files from hard drive or add new hard drive with larger size.
Incorrect account permission is the another reason for 945 error.
So, we always make sure that the account to perform operations has the right the permission.
For example: As part of database recovery, the user might have to excecute CREATE and INSERT scripts. But if the user has only read access to the database, it may lead to 945 error.
We follow the steps as shown for adding permission for a user.
- Connect to SQL Server instance and from the Object Explorer expand the folders. Then, right click on the name of the user and choose Properties.
- Click the Securables option and click on search.
- Select All Objects belonging to the Schema and Select Schema name as “dbo”. Then, Click OK.
- Next, Identify the table to grant permission.
- Finally, In Explicit>>Permission>>choose the permission>>Grant and Click OK.
Set database to Autogrowth
Auto-growth is a process due to which SQL Server engine expands its database size when it is running out of space. MS SQL error 945 can occur in a scenario where Autogrowth is disabled.
So, for enabling it we follow the steps shown:
- Open SQL Server Management Studio and connect to the database haivng issue.
- Then, click “View” >> “Object Explorer”.
- Next, expand the “Database” folder.
- After that, right-click the database and choose “Properties”.
- Finally, under “Select a Page”, choose “Files” and look for the Autogrowth settings and check the option “Enable Autogrowth”.
Check the MDF and NDF files
MDF and NDF files are primary and secondary data files of an SQL server database.
We may encounter MS SQL error If the MDF or NDF file of the database is marked as read-only.
So, for removing read-only on the MDF or NDF file we follow thw steps shown:
- Search and right-click the “.mdf “or “.ndf” file of database.
- Then, choose “Properties” >>”Security”, there we can see Group or Username.
- Select the user we want to give access to the file and check the permission.
- If the permission to the user is not set to Full Control, we need to change it by clicking “Edit”.
- Then appears Group or Username box. From there select the user and choose “Full Control”.
This fixes the error
[Need assistance in fixing MS SQL errors? Click here to talk to our experts.]
In short, we saw that MS SQL Error 945 can occur due to different reasons like lack of storage, corrupt backup file,Improper shutdown of the database, etc. Also, today we discussed different possible ways by which we can fix this error easily.