This document shows you how to fix a SQL Error Code 20 for a database that is not attached.
Before you Begin
- Make sure the Windows account you are logged into has Administrator privileges
- Check Administrator Privileges if you are unsure.
- IMPORTANT: Make sure Windows 10 is fully updated before continuing.
- To check if you are up to date, view the Microsoft support article:
How to Attach your SQL Database
1. Check to see if Database File is in Proper Location
- Open Windows File Explorer
- Navigate to C:\ProgramFiles\Microsoft SQL Server\MSSQL14.PBI_MYOVISION\MSSQL\DATA
- Confirm MyoVision and MyoVision_log database files are in the folder
2. Move, Attach, or Troubleshoot database files
- If the Database file is in the DATA folder;
- Move to Troubleshooting section
- If the Database file is not in the DATA folder,
- Perform Step 9 and 10 Moving and Attaching Database Files in the Install SQL Server 2017 support article
- If a permission error appears, like the one shown below, follow the steps under Troubleshooting
If you are getting a permissions issue error, you will need to change the permissions for the DATA folder. Once you've done this, go back to the previous section and try steps 1 and 2 again.
1. Open DATA Folder Properties
- Open File Explorer and navigate to C:\Program Files\Microsoft SQL Server\MSSQL14.PBI_MYOVISION\MSSQL
- Right-click DATA, select Properties
2. Edit Groups/User Names
- Click the Security tab in the window that pops up.
- Check under "Group or user names" to see if Users is listed.
- If so, skip ahead to Step 3: Edit Permissions
- If Users is not listed, click Edit
- In the Permissions window that opens, click Add
- In the Select Users or Groups window, click Advanced
- Click Find Now, find and selected the "User" account in the list at the bottom of the window
- If there is no User account, look for Domain User or other group that ends in "User"
- Click Ok, then click OK in Select Users or Groups window
3. Edit Permissions
- Now that Users or Domain Users has been added, click on it under "Group or user names" and allow Full Control. Click OK to finish
4. Attach the database
- Perform Step 10. Attaching Database Files in the Install SQL Server 2017 support article
- If the database is not working, an SQL error will appear. See the links below for help with the SQL Error
Note: If you are still having trouble getting your MyoVision database to work properly, please feel free to contact our technical support at 1-800-969-6961, option 2 (8:30am - 4:00pm, Monday - Friday) (+1 206-448-3464 International)