I have a LocalDB running and I can log in to it via SQL Server Management Studio. I've granted my user db_datareader and other roles, but the Object Explorer tree still does not list Tables under Databases > System Databases > master.
I can create tables and select, etc. They show up in information_schema.tables with "master" as the table catalog. I created a view and it does show up under Views, so the issue seems to be limited to tables.
I don't know what else to try - any idea?
try one press on the name of the database , and then press the refresh circle line on the top of the object explorer. may be now it will work. you can see picture added.
Related
Why do you have to drop a linked server before you can make changes to the server? Why can you not view properties of the server i.e. username access rights etc? Is it practical to drop a table first before having the ability to alter it and make changes? Is it safe to use drop and create to in order to get properties of the linked server or will the settings be removed? Is there a SQL command that would allow you to view properties of a linked server?
Yes, you can view the properties of the linked servers, and you may make changes on tabs #2 and #3. The first tab can not be changed, IE: server type and name.
To see the linked servers in MSSMS, look under "Server Objects", Linked Servers", then right click on the linked server and select properties.
Recently I run into a scenario, where
I created a table in a database.
Refreshed the tables in Object explorer
Table appeared in the list
I used the query 'select * from sys.tables' and selected the database in dropdown list
Executed the query
Table NOT in the list
We are using SQL server 2008 R2 and this issue is observed on our clients machine. Sadly, I don't know much about the history of the database.
Has anyone seen this issue before. Any little help will be greatly appreciated
Finally figured out the issue..
Issue is because we are using remote connections. It seems SQL query editor will remember the connection. So query editor is using one connection and Object explorer is using a different connection. They both are not pointing to the same server.
So when we created a table using SSMS, then we can see the table created, but not the same when used with query editor. As both the servers has same databases we always thought that it's the same server.
To change the connection of query editor, Right click on the sql query editor -> Connections -> Change connection.
With this we changed the connection of the query editor. And now both Object explorer and query editor are in sync, and we can see the table that is created.
Happy ending!!
#Mortb and #Manngo, once again many thanks for your contribution..
I have a database server with several databases on it. I'd like to create a login for one of these databases, but when the user logs in to the server, I don't want the other databases on the server to show up. Is this possible?
I've created a login on the server and gave that login the db_readonly role on just one server. However, when I connect via SQL Server Managment Studio, I see a list of all of the databases. I can't see what tables are defined in each of them.
I want to remove this clutter so that when a user connects there is only one (or two if you include master) database available.
you may use the SSMS interface as following: -
1) Go to your SQL Server Instance, right click and select Properties.
2) Choose Permission on the left pane.
3) Select the specific user that you mention on the "Logins or roles" section.
4) At the permissions for section, check on Deny column for "View any database"
5) Go to the newly added databases, right click and select Properties.
6) Add the specific user under "Users or roles"
7) At the permissions for section, check on Grant column for "View database state" or any other permission that you would like to grant"
I have two versions of the same database, say DB1 and DB2. DB1 is a copy made of the mdb and the log file a month ago. The database structure and data has changed since then. I need to switch back and forth between these two copies in SQL Server Management Studio.
The structure of the Customer table in these versions is different. So it is easy to see which version is loaded in Management Studio.
I detach DB1 and attach DB2 and do select * on Customer and see the structure still belonging to DB1. How do I switch to DB2 properly?
I am using the right use DB statement and have the right db selcted in the dropdown on the left hand side for selecting databases.
The drop-down at the top controls which DB you are using, if the DBs are on the same instance of SQL Server. If they are different instances, use the "change connection" button at the top left, then pick your DB from the drop-down.
Somehow Management studio was caching the location of the file. When attaching the database, I had to go to the "current file path", and edit the wrong path and point to the right one. This had to be done even when after clicking the add button I had already chosen the right mdb file with the right path.
I installed SQL Server 2005, and I want to create a database but I can't. When I right click on the Database Diagrams folder for my database in SQL Server Management Studio 2005, I don't see any choice for creating database diagram. I see two things:
Working With sql server 2000 Diagrams
Refresh
The ERD diagram created by the wizard in SQL Server Management Studio is a physical ERD, not a logical one. It's not like using Oracle Designer...
You need to create your table(s) first, and relate as necessary. Once you have at least one table defined, the ability to create a Database Diagram should appear.
I have tried this in the past and tried it again now after seeing this post. Here is my experience with SQL 2005 Management Studio (connected to SQL Server 2005):
If you create a blank database (no tables) and click on "Database Diagrams" you are prompted with:
"This database does not have the objects required to create database diagrams. Do you want to create them?"
If you answer yes, you can right click on Database Diagrams node and click "New Database Diagram". The default prompt comes up with the title "Add Table". This is good if you already have tables and want to add to diagram. However, it only gives options to "Refresh". The add button though present is disabled (we do not have tables yet).
Now to create a table, you can close the "Add Table" dialogue and right click in the right hand side pane and click "New Table"
From hereon, the process of creating a table is intuitive. When you save the diagram, the table gets created in the database.
Expand folder, it should prompt to install objects. Then you should be able to add diagrams.
In the first place, you shoud be creating tables by writing scripts not using the GUI.
The symptoms you describe indicate the database was created as a SQL Server 2000 database and thus you cannot use the diagram creator in SSMS for 2005. If you feel you must do this with a diagram instead of with a script, then you must use Enterprise Manager. If you had clicked on the 1.Working With sql server 2000 Diagrams choice, then SQl Server would have told you this.