Schema browser in SQL Server Management Studio 2012 - sql

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.

Related

Cannot populate list of SQL views or tables in Azure Data Share setup

I am attempting to share an SQL view via Azure Data Share. I have set up the data share, created a share to send, and am attempting to add a dataset. I am logged into Azure Portal as me#example.com. I am also connected to the database (an Azure SQL DB) in SSMS as me#example.com. I do the following:
Select "Add datasets"
Select "Azure SQL Database"
Select the resource group
Select the SQL server
I got the the message about setting up permissions (the create user and exec sp_addrolemember db_datareader query), which I did successfully in SSMS. So, next I select the data, which was found successfully, and select "Next". This is where the problem starts.
I am given the options for Tables and Views. However, neither is populated. I can see all the tables and views in SSMS, including the view I created. However, when I select, say, "View" from the 2 options, it finds nothing and says, "No results to show".
This is mystifying. I clearly have access and permissions, yet it won't even populate the list of views. Any suggestions what might be causing this? This is my first Azure Data Share, and I could easily have missed something, but it seems like it should have everything that it needs for this operation.
Here are my assumptions:
It is using my Azure Portal login credentials to authorize access to populate the list.
The fact that I can see the tables and views in the SSMS Object Explorer implies sufficient permission to see the same in Azure Portal.
Since this data share and the database are in the same resource group, no firewall configuration is needed.

Can't relink mdb file with Linked File Wizard

So, I've got an access database that I want to open.
I can see the querys/forms/tables exist but when I want to open them it tells me
"X:[...]\database.mdb" is not a valid path. Of course, because this is my computer. So when I select them to relink them in the wizard, I select the current database file and it just tells me, that the query/form/table doesn't exist in there and I should check the name.
But I am in that database and I can see those forms exist. The database itself is just around 1mb, is there something msissing maybe? Don't think so, huh.
It looks like your Access database project has been split into Front-End and Back-End databases.
This is normal practice for an Access database project of any significant size.
It seems you have the front-end database - this is the one containing the forms etc. Yes, it will list the tables but all those tables are just links. The underlying data is not in this front-end database, but in the back-end.
If your tables are shown with a small arrow then these are linked tables and a sure sign you have a front-end database:
When you fire up the Linked Table Wizard you need to browse to the back-end database, not the current database. If you cannot locate the back-end or no longer have it, then basically, you have no data. Your front-end database may be of little value on its own.

How to hide all databases I am not authorised to use in Sql Server 2005 Management Studio?

I have to access some customers databases being hosted in a shared environment. There are numerous databases being hosted on any given customers instance. So everytime I access a database I have to scroll and search.
I would like to be able to configure Management Studio to just go directly to the database I want to work with for a given connection and hide all others on that connection/instance. But i still want to be able to see databases on other instances i might be working with, i.e. local using the same Object Explorer.
If that not possible is there any reason why the web hosting provider would grant their customers the VIEW ANY DATABASE permission? Im assuming thats why I can see all the other dbs?
If i cant configure Management studio to do what i want as per (1) then I was going to email the provider and ask that they prevent me from seeing them from the "server" end. Would this be an easy thing for them to do? If they REVOKE the VIEW ANY DATABASE permission then that should solve my "problem" right? But would it create any others?
You will require access to the master db to effect the outcome you want. There are no options to configure Sql Server management Studio (SSMS) to do what you want.
So (1) is out.
(2) however is a go so long as your service provider play alongs. You are right they will have to
DENY VIEW ANY DATABASE TO youruseracount
which will require access to the master db. But before they do this they will have to set youruseraccount as the owner of your database.
sp_changedbowner 'youruseraccount'
The side affect of all of this is
a. You wont be able to see any other databases in the instance which is what you want.
b. Only one user will be able to use SSMS to admininster your database with the 'View Only My Db' list. This is because only one user can be the Database Owner.
..
Richard
2 articles describe it (no point if I copy/paste, really)
One and Two

SQL Server Management Studio Display Database Diagrams (ER) Permissions

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.

Create Diagram in SQL Server Enterprise Manager (SQL 2000)

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.