SQL Error Code 20 - Database not Attached

Summary

This document shows you how to fix a SQL Error Code 20 for a database that is not attached. 

Before you Begin

  1. Make sure the Windows account you are logged into has Administrator privileges
  2. IMPORTANT: Make sure Windows 10 is fully updated before continuing.

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

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

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)