Link to home
Start Free TrialLog in
Avatar of Mike Eghtebas
Mike EghtebasFlag for United States of America

asked on

How to create database diagram

I have downloaded and restored adventureWorks2014 database, Now I want to build entity diagram. Upon selecting adventureWorks2014/Database Diagrams I am getting the following message:

TITLE: Microsoft SQL Server Management Studio
------------------------------
Database diagram support objects cannot be installed because this database does not have a valid owner.  To continue, first use the Files page of the Database Properties dialog box or the ALTER AUTHORIZATION statement to set the database owner to a valid login, then add the database diagram support objects.

There are two areas I can think of some changes have to be made:
1) InstanceName/Properties/permissions as shown below:User generated image2) SQL Server Folder Name/Properties/Security Tab as shown below:User generated image
Question 1: How can I change these settings so I can continue building diagrams for this database (I want to see the table structure for this database)?
Question 2: What resources do you suggest for me to continue for better understanding of these types of SQL Server admin activities?

Thank you.
ASKER CERTIFIED SOLUTION
Avatar of Deepak Chauhan
Deepak Chauhan
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The database needs a dbo user. Just add your login (or sa login) as dbo for that database.
The next command will do the work (you can change the login name of course):
exec sp_changedbowner 'sa'

Open in new window

Avatar of Mike Eghtebas

ASKER

This instance is on my laptop. When I installed it (SQL Server 20140 sometimes ago, I think i set myself as SysAdmin.  How can I read the exact syntax of the existing db_owner and SysAdmin before I modify either?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
@Vitor,

This image below shows one record. There are more than one schema in this database.
User generated imageBTW, how can I read the exact syntax of the existing db_owner and SysAdmin before I modify either?
Please check in the database users if the dbo has a login name associated.

BTW, how can I read the exact syntax of the existing db_owner and SysAdmin before I modify either?
I'm sorry but I'm afraid I didn't understand the question.