Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Why are tables not showing up in Object explorer in database

Tags:
  1. Jun 3, 2016 #1

    WWGD

    User Avatar
    Science Advisor
    Gold Member

    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.
     
  2. jcsd
  3. Jun 3, 2016 #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.
     
  4. Jun 3, 2016 #3

    WWGD

    User Avatar
    Science Advisor
    Gold Member

    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?
     
  5. Jun 3, 2016 #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.
     
  6. Jun 4, 2016 #5

    WWGD

    User Avatar
    Science Advisor
    Gold Member

    Thanks, NJ runner, will follow up Monday when I am back at work.
     
  7. Jun 6, 2016 #6

    WWGD

    User Avatar
    Science Advisor
    Gold Member

    @newjerseyrunner : Duh on myself, I was logging on to the master database. Thanks for your patience.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted



Similar Discussions: Why are tables not showing up in Object explorer in database
Loading...