SQL Server Express while attaching a database getting error 5120

21

The minimal permissions needed to attach a database file is 'full control'. If you want to attach the database using SQL Server Management Studio, the account running SSMS must have full control on both the database MDF and LDF files

To grant privileges to files:

  1. Right click the file in Windows Explorer
  2. Open the Security tab
  3. Click Edit
  4. Click Add and add the SSMS account
  5. Grant Full control
  6. Go to SSMS and try to attach the file again

You can copy the file to another folder, to avoid C root, you might not have enough permissions there

Share:
21

Related videos on Youtube

query_weary
Author by

query_weary

Updated on September 18, 2022

Comments

  • query_weary
    query_weary over 1 year

    Help!

    df = df[df.groupby('id')['metric'].transform('max')==df['metric]]
    

    and now my other functions don't work. I tried

    df.reset_index(drop = True, inplace=True)...... #nope!
    

    I tried to start from the very beginning - import libraries and re-read csv's and nope!

    what happened?

    df['d_d_Mean'] = df[df.groupby('id')['drugs'].transform('max')==df['drugs']]
    

    Error:

    <ipython-input-607-85fda50bf5a4>:12: SettingWithCopyWarning:
    A value is trying to be set on a copy of a slice from a DataFrame.
    Try using .loc[row_indexer,col_indexer] = value instead
    
    See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
    
    • Ash Burlaczenko
      Ash Burlaczenko over 10 years
      Access is denied is quite a self explanatory error.
    • Renju Chandran chingath
      Renju Chandran chingath over 10 years
      move the file to some other folder having a full permission or execute permission for the SQL service account and then try to attach file.
  • MaxPayne
    MaxPayne over 8 years
    Worked for me tooooo. One addition from my end: I have multiple databases inside a folder so I Right clicked on the Folder instead of file and follow the above process. All databases inside that folder are working now.