4

I have a simple database:

enter image description here

When I try to add a database diagram, it gives the following error:

a member of the db_owner role must use the database diagramming functionality error

Please note that my database is not a local database, in localhost it is ok to create a diagram, but when i connect to my sql server (server: webtcc.ir,1437) it gives the error.

I'm using entityframework in my website and I need to create relationship. Any helps?

Ali.Rashidi
  • 1,284
  • 4
  • 22
  • 51

2 Answers2

2

The error means just what it says. The user your connecting is not part of the db_owner role for that database. You either need to connect as a user who is or give your use the role from within the database's permissions. This SO post will walk you through how to do that, presuming your host will let that happen or you might have to put in a request to your host for the modification.

As far as creating a relationship this is actually not needed in order to do that. The Diagram will just show you a visual representation of all the tables in your database and how they are currently related to each other. If you need help making the relationship in Entity Framework please post up a new question with the problem your having and your current code for that.

Community
  • 1
  • 1
Matthew Verstraete
  • 6,335
  • 22
  • 67
  • 123
  • I actually need to create relationships between tables. how can I do that without diagrams? – Ali.Rashidi Apr 26 '16 at 14:09
  • As stated that would be a different question you would need to post. If you post up the question and the code definitions for both tables in EF (assuming code first) we can help you out on that. – Matthew Verstraete Apr 26 '16 at 14:40
-2

I had this exact same error. But I disconnected the current connection which was SQL Server Authentication connection and reconnected using Windows Authentication. After this I am able to create Database Diagram in SQL server management studio with no more error message.