Check out this strange little ocurrence I just came across in SQL Server Management Studio (SSMS). It thinks a table is in my database when actually it isn't. Check out the screen shot below taken from my attempt to build a database diagram:
See anything not quite right here? The highlighted [Entity] table doesn't actually exist in my database. In actual fact I removed it not long before building this database diagram. And just to prove that it doesn't exist here's what I get when I try and add it to my database diagram:
So OK, SSMS handles this problem elegantly but I'm intrigued as to why it thinks the table is there in the first place. I ran a trace to see if there was some faulty metadata coming out of the server's data dictionary but I couldn't see any statement being issued that actually requested any such information hence it didn't look like this was a case of faulty server metadata - that was a relief.
My next guess was that SSMS caches the metadata somewhere and that was more-or-less confirmed when I ran up another instance of SSMS and found that the problem did not occur - even though it carries on happening in my first SSMS instance. Interestingly I disconnected from the server within object Explorer and reconnected and the problem still occurred after that.
So, is this a bug in SSMS? Is this a well-known occurence that I'm simply naive enough not to know about yet? I'm interested to know.
Strange!
-Jamie