Why are tables not showing up in Object explorer in database

  • #1
WWGD
Science Advisor
Gold Member
2019 Award
5,174
2,475

Main Question or Discussion Point

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.
 

Answers and Replies

  • #2
1,516
617
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
WWGD
Science Advisor
Gold Member
2019 Award
5,174
2,475
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
1,516
617
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
WWGD
Science Advisor
Gold Member
2019 Award
5,174
2,475
Thanks, NJ runner, will follow up Monday when I am back at work.
 
  • #6
WWGD
Science Advisor
Gold Member
2019 Award
5,174
2,475
@newjerseyrunner : Duh on myself, I was logging on to the master database. Thanks for your patience.
 

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

Replies
10
Views
754
Replies
4
Views
2K
  • Last Post
Replies
8
Views
5K
Replies
3
Views
677
  • Last Post
Replies
10
Views
1K
Replies
3
Views
1K
Replies
5
Views
708
  • Last Post
Replies
5
Views
543
Top