What is the lowest permission level I need on a user to be able to create diagrams in SQL Server Enterprise Manager?
I'm currently set as data reader and I am unable to create diagrams. (I wouldn't expect to be able to at this permission level)
The database diagrams feature is actually a quite powerful schema editor - you can change tables/fields and relationships as well. (don't know why they did it that way). I'd imagine you need quite high permissions to be able to create diagrams because of the editing possibility - probably owner or ddladmin.
After some further investigation, with the dbo role, I was able to create database diagrams.
Related
In Toad for SQL there is an option: Schema Browser, under the Database tools. Does this option exist for Microsoft SQL Server Management Studio 2012? If not, is there another easy option I can view and browse the tables without writing SQL?
That depends on what you want to see. If you just want to see the tables that exist and any defined foreign key relationships you can use the database diagram functionality of SSMS.
Expand the database you want to explore and right click the "Database Diagrams" folder then select "New Database Diagram". After that you will be able to select which tables and views you want to see in the diagram.
If this feature hasn't been used before then you (or someone else) will need db_owner access to enable it and have it create the underlying tables that support the diagrams. Once diagrams have been enabled by a db_owner user any user can create them.
Note: The only users who can see a diagram are the diagram's creator and any member of the db_owner role.
More information:
Set Up Database Diagram Designer (Visual Database Tools)
Understand Database Diagram Ownership (Visual Database Tools)
The answer #Mike D. gave seems best, if the appropriate access has been granted. The next best option would be to use the Object Explorer pane and Object Explorer Details tab.
Right clicking an object in the Object Explorer pane includes:
Select Top 1000 Rows (much like Toad's Schema Browser's Data tab)
Script Table as > (which allows one to see the Script as a CREATE, DROP, etc.)
Properties (which shows Permissions, Storage statistics, etc.)
The Object Explorer Details tab can show
Fields and their definitions, sortable by name
Indexes (definitions, columns, etc)
Triggers
among other things.
I haven't had time to explore all of it, but this may be the best Schema Browser surrogate if lacking access to create/use Database Diagrams.
I have a window Application and I have some tables in database(sql server) that can be updated from the application .I need to host this database to the client machine .How I can protect our tables to be modified directly.Its a simple sql table that has some Data.Please Help.
You can use GRANT to remove the "unwanted" rights (e.g. UPDATE) from the user(s).
In general I would use database-level roles for that: introduce a special "read-only-role" and GRANT the needed rights (in your case only SELECT) to that role.
Second create a kind of "writer-role" and do the same (e.g. with INSERT,UPDATE,DELETE).
This is only an example - you should make clear what roles/user groups you need on database level and what rights these roles should have.
Try to keep it simple and give as few right s as possible to the users.
For further help - this article gives a nice introduction.
Please also have a look at the Identity and Access Control-section of the SQL Server 2008-R2 Technet documentation.
Hope that helped a bit.
*Jost
I am not a DBA and so dont really know anything about SQL 2005 security settings, etc. I am attempting to set up an empty copy of our database by generating the full database from SQL Management Studio generated scripts. Unfortunately I don't know what many of the options do and the MSFT documentation of this processes isn't great.
There is an option to generate script for Schemas, Tables, Views and Users. It is the users I am confused about, because I don't understand how they affect the usage of the database. We have some developers in the team who are in this list and some who are not, yet everyone can do anything on the database, at least when they are hosting it on their own machines.
Do I need to keep these Users in my new generated database and what do they do?
We also have a dbo User who is a db_owner and owns many of our schemas. What is this dbo User? What is the significance of a user Owning Schemas? We use Schemas as "namespaces" to group logically related tables in our database but I take it there is more to them than that?
There is also a username tied to this dbo User, its the windows NT login of one of our developers, but he doesn't have his own User object in the list...is there any significance to this? Is this a bad thing?
Other Users are guest, INFORMATION_SCHEMA and sys, but I think these are all defaults?
Sorry but I am a SQL admin ignoramus and usually left these things to the DBA in my previous job!
Thanks for any help.
Do I need to keep these Users in my new generated database and what do they do
The answer is it depends. If your applications use a mixed mode authentication then you will need the user accounts created in SQL. If you use windows authentication (and it sounds like you are) then you might not need them.
What is the significance of a user Owning Schemas?
In SQL Server 2005 all schemas must be owned by a user. Schemas can be used to group functionality but they can also be used to group security. For example a user account may only have access to a specific schema (or multiple schemas).
Hopefully that helps answer some of your questions
I was wondering if anybody knew exactly what permissions where needed on a database in SQL Server 2005+ so that when a person uses SQL Server Management Studio, they could then be able to at minimum see the Database Diagrams.
I have tried giving the person db_datareader, db_datawriter, and db_ddladmin, but to no avail.
I have also tried giving them access in the Properties → Effective Permissions of the user. Under Effective Permissions, I could not find the database object type for "database diagrams" or anything like that to give the user access to.
They are running SQL Server Management Studio (non-express version.)
Any help would be great.
FYI, I did not want to give them db_owner access.
EDIT:
As to one of the comments: Yes, the database is an SQL Server 2005 database.
As to one of the answers, moving the DB from production to development is not an option.
Giving admin rights is not the right approach, you need to be Database Owner for Database Diagrams, check out this thread for more details.
First you need to set up Diagram Designer (you need to be db_owner for that). Just expand the Diagrams node, and press 'Yes' to enable diagramming.
After that all other db users can create diagrams and see their own diagrams. Only db_owner can see other's diagrams.
Also the db_owner can change diagram owner to himself, but the original owner must be removed from database before doing that.
Copy the database to a development system, and grant the developers administrative rights. Anything else is a waste of time (like researching this question.)
See this post for better explanations.
Is this possible?
We have a Configuration Management Database that stores information such as our servers, what datacentre they're stored in, applications that reside on them, as well as interfaces that send data from one application to another.
We would like to use Visio to connect to our SQL 2005 database, and automatically generate a flow diagram that details these dependancies and relationships.
So again - is this possible? If so, does anyone know of some documentation that details how to do this?
Is this what you are looking out for?