Why are tables not showing up in Object explorer in database

  • Thread starter Thread starter WWGD
  • Start date Start date
  • Tags Tags
    Database Sql
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
5 replies · 7K views
Messages
7,831
Reaction score
13,158
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.
 
Physics 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