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:permissions2) SQL Server Folder Name/Properties/Security Tab as shown below:security
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.
LVL 34
Mike EghtebasDatabase and Application DeveloperAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Deepak ChauhanSQL Server DBACommented:
You need DB_owner role in the database if you are not SysAdmin on this sql server.

USE <databaseName>
GO
EXEC sp_addrolemember N'db_owner', N'<userName>'
GO

eg: EXEC sp_addrolemember N'db_owner', N'Test' -- for sql login
eg: EXEC sp_addrolemember N'db_owner', N'Domain\test' -- for windows authenticated login.

Once you have this role you can see table structure as well.

@What resources do you suggest for me to continue for better understanding of these types of SQL Server admin activities?

Involve a person who have good knowledge of SQL server DBMS.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Vitor MontalvãoMSSQL Senior EngineerCommented:
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

0
Mike EghtebasDatabase and Application DeveloperAuthor Commented:
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?
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Vitor MontalvãoMSSQL Senior EngineerCommented:
You can run the following query in the database. If doesn't return a record means there's no dbo and you should create it.
SELECT *
FROM sys.sysusers
WHERE name='dbo'

Open in new window

0
Mike EghtebasDatabase and Application DeveloperAuthor Commented:
@Vitor,

This image below shows one record. There are more than one schema in this database.
SQl2014BTW, how can I read the exact syntax of the existing db_owner and SysAdmin before I modify either?
0
Vitor MontalvãoMSSQL Senior EngineerCommented:
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.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.

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.