Why are tables not showing up in Object explorer in database

  • Thread starter Thread starter WWGD
  • Start date Start date
  • Tags Tags
    Database Sql
Click For Summary

Discussion Overview

The discussion centers around a user's issue with not being able to see tables in the Object Explorer of MS SQL Server 2012 after successfully creating a database. The conversation explores potential reasons for this problem, including the absence of data and transaction handling.

Discussion Character

  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant questions whether the lack of 'Insert' statements in the database creation script is the reason the tables are not visible in Object Explorer.
  • Another participant suggests checking access to the console and running the command "SHOW TABLES" to verify the existence of tables.
  • There is a mention of the possibility that an uncommitted transaction could cause the tables to not appear.
  • A participant describes their process of creating the database and tables, indicating they refreshed Object Explorer and restarted the session without success.
  • One participant advises trying the "DESCRIBE" command on the tables to gather more information about them.
  • A later reply reveals that the user was mistakenly logged into the master database instead of the intended database.

Areas of Agreement / Disagreement

Participants express uncertainty regarding the visibility of tables, with multiple suggestions offered but no consensus on the exact cause of the issue.

Contextual Notes

There are limitations regarding the user's understanding of transaction management and database context, which may affect their ability to see the tables.

Who May Find This Useful

This discussion may be useful for users experiencing similar issues with database visibility in MS SQL Server, particularly those new to database management or SQL scripting.

WWGD
Science Advisor
Homework Helper
Messages
7,802
Reaction score
13,105
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
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.
 
  • Like
Likes   Reactions: WWGD
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?
 
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.
 
  • Like
Likes   Reactions: WWGD
Thanks, NJ runner, will follow up Monday when I am back at work.
 
  • Like
Likes   Reactions: newjerseyrunner
@newjerseyrunner : Duh on myself, I was logging on to the master database. Thanks for your patience.
 
  • Like
Likes   Reactions: newjerseyrunner

Similar threads

Replies
5
Views
3K
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 4 ·
Replies
4
Views
7K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 1 ·
Replies
1
Views
404