Why are tables not showing up in Object explorer in database

In summary, the individual successfully created a database in MS SQL Server 2012, but the tables from the database were not listed in the object explorer. The database did not contain any data and when attempting to run an insert statement, an error was received. The individual was unsure of what they were doing wrong and asked for help in determining why the tables were not listed. It was later discovered that they were unintentionally logged into the wrong database.
  • #1

WWGD

Science Advisor
Gold Member
6,643
9,629
Hi all,
I successfully created (scripted) a database in MS SQL Server 2012. My problem is that while the database itself is listed in the object explorer , the tables from the database are not. The database I scripted did not contain actual data, i.e., there were no 'Insert' statements. Is this last the reason why the tables are not listed? I tried to see if the tables were stored somehow without appearing by running an insert into statement for one of the tables in the script statement , but I get the error statement : " Msg 208, Level 16, State 1, Line 1 Invalid object name 'ContactInfo'. "

What am I doing wrong? Why aren't the database tables listed? Thanks.
 
Technology news on Phys.org
  • #2
Do you have access to an actual console? What do you get when you type in
"SHOW TABLES"?

Is the transaction still open? If you used a transaction and forgot to "commit" it'll all disappear.
 
  • #3
Thanks, NJRunner. Yes, I have access to a console .I scripted the database in the usual (at least to me) way : Create database..go Create table Table_name (Field1 data type 1,...). Create Table Table_name2 ,... Then I ran it as a query. The database itself showed up . I refreshed object explorer. I closed the session , reopened it.
How does one commit the database?
 
  • #4
If the db itself showed up, then it must have been committed. What happens when you run SHOW TABLES? Do you get a list of the tables? Also try a DESCRIBE on one of your tables, it'll tell you a lot about it.
 
  • #5
Thanks, NJ runner, will follow up Monday when I am back at work.
 
  • Like
Likes newjerseyrunner
  • #6
@newjerseyrunner : Duh on myself, I was logging on to the master database. Thanks for your patience.
 
  • Like
Likes newjerseyrunner

1. Why are my tables not appearing in Object explorer?

There could be a few reasons why your tables are not showing up in Object explorer. One possibility is that you are connected to the wrong database. Make sure you are connected to the correct database where the tables are located. Another reason could be that the tables have been accidentally deleted. Check to see if the tables still exist in the database.

2. How can I troubleshoot the issue of tables not appearing in Object explorer?

To troubleshoot this issue, you can try refreshing the Object explorer or restarting the program you are using to access the database. You can also check your permissions to ensure that you have the necessary rights to view the tables. Additionally, you can run a query to see if the tables exist in the database.

3. Can a corrupted database cause tables to not show up in Object explorer?

Yes, a corrupted database can cause tables to not show up in Object explorer. If the database is corrupted, it may not be able to properly load and display the tables. In this case, you may need to restore a backup of the database or seek assistance from a database administrator to repair the database.

4. I can see the tables in the database, but why are they not appearing in Object explorer?

It is possible that the tables are not appearing in Object explorer because they have been filtered out. Check the settings in Object explorer to see if there is a filter applied that is hiding the tables. You can also try resetting the Object explorer settings to their default values.

5. Is there a limit to the number of tables that can be displayed in Object explorer?

There is no specific limit to the number of tables that can be displayed in Object explorer. However, if you have a large number of tables in your database, it may take longer for Object explorer to load and display them. You can try increasing the timeout settings in your database connection to give Object explorer more time to retrieve and display the tables.

Suggested for: Why are tables not showing up in Object explorer in database

Replies
50
Views
3K
Replies
51
Views
3K
Replies
6
Views
896
Replies
14
Views
1K
Back
Top