Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

In SQL Server Management Studio, when I run the query

select * from tablename

it shows me the data.

But, that table is not physically present in that database. Is it possible?

share|improve this question
add comment

2 Answers

It may be that tablename isn't actually a table but is another database object that acts like a table.

To find out, run this bit of T-SQL in the database containing tablename:

select schema_name(schema_id),name, type from sys.objects where name='tablename'

This will return rows if it finds for any object called tablename in the database. If it returns 1 single row, and type is U then it is a table and you'll need to see why it's not showing in SSMS. This could be just that it needs refreshing, or your view may be filtered by schema or something else.

If the second column isn't a U then the object isn't a table (ie; it could be a view, or a synonym for another table, etc). There is a lookup list of values here - http://msdn.microsoft.com/en-gb/library/ms190324.aspx - which you can use to identify the object type.

share|improve this answer
add comment

Maybe you forgot to Refresh the object browser.

share|improve this answer
    
Sounds a possibility. Some instructions on how to refresh it would improve this answer though. –  Martin Smith Feb 6 '13 at 9:50
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.