• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 837
  • Last Modified:

SQL 2005 Express Database is Readonly

alter database [enrollmentdb] set read_write

I am getting these errors
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database 'enrollmentdb' or the database does not exist.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.

Becuase of this issue, i am not able to modify the design of table.
  • 5
1 Solution
Go into SQL server security settings and make sure your login has 'dbo' access to the database, or that your login is tagged as a sys admin.
chokkaAuthor Commented:

1) This is an attached database. This database will used locally for all our client machines.

2) I am not able to find Username ( i.e sa ), under Login.

I have attached the screen shot of this issue.

Do you have the S.A password? As I suspect the tables are locked by that
Build your data science skills into a career

Are you ready to take your data science career to the next step, or break into data science? With Springboard’s Data Science Career Track, you’ll master data science topics, have personalized career guidance, weekly calls with a data science expert, and a job guarantee.

chokkaAuthor Commented:

username : sa
password : chokka123

But in .net connection string, i mentioned as follows ..

"Data Source=CHOKKA\SQLExpress;Integrated Security=true; AttachDbFilename=C:\Enrollment Form\EnrollmentDB.mdf;User Instance=true;"
chokkaAuthor Commented:
Earlier, i was logged on sa / chokka123..


I have logged on Windows Authentication.

What i have to do?
chokkaAuthor Commented:

On trying to provide

dbo setting for the username sa

i am facing these issues
TITLE: Microsoft SQL Server Management Studio

Alter failed for Login 'sa'.  (Microsoft.SqlServer.Smo)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.0.1600.22+((SQL_PreRelease).080709-1414+)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Alter+Login&LinkId=20476


An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)


Cannot set a credential for principal 'sa'. (Microsoft SQL Server, Error: 15535)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.1399&EvtSrc=MSSQLServer&EvtID=15535&LinkId=20476



Open in new window

chokkaAuthor Commented:

Either using Windows Authentication or SA user authentication, I am not able to login to the database
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Train for your Pen Testing Engineer Certification

Enroll today in this bundle of courses to gain experience in the logistics of pen testing, Linux fundamentals, vulnerability assessments, detecting live systems, and more! This series, valued at $3,000, is free for Premium members, Team Accounts, and Qualified Experts.

  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now