I keep getting the error message:
an exception occurred while executing a transact-sql statement or batch
when trying to do anything in SQL Server Management Studio 2016.
This occurs when I try to create or edit a login, when I try to create a new database, basically when I do anything.
I tried the solution given in SQL Server 2008 R2 Express permissions -- cannot create database or modify users but I can't edit the Startup Parameters specified in step 6.
Can anyone explain what the issue is and how to solve it?
84 Answers
I got this error message while trying to attach DB, if it's your case, go to to the folder where your DB is:
- Right click => properties => security => advanced
- Make sure the correct user has 'full control' permission
- If not:
- Click on 'Change permissions'
- Set 'full control' permission to the relevant user (or all of them)
- Try to attach again
It works for me.
Thanks to everyone who tried to answer the question, but I was able to solve it. It is the same procedure mentioned in SQL Server 2008 R2 Express permissions -- cannot create database or modify users. However, in step 6 instead of adding "-m" to an existing parameter, you have to create a new parameter called "-m" and follow the remaining steps. This resolved the issue.
0I got same issue but when i tried with query it was succeeded. try below
CREATE DATABASE databasename; I fixed it a different way
I put the .bak file in "C:\Program Files\Microsoft SQL Server\MSSQL15.MSSQLSERVER\MSSQL\Backup"