Table hiding in SQL Server database?

…衆ロ難τιáo~ 提交于 2019-12-04 12:42:18
select Schema_name(schema_id) from sys.tables where name ='Table_report';

which schema is the result? If you want to move it do that:

ALTER SCHEMA dbo
TRANSFER SchemaSource.Table_report;

http://msdn.microsoft.com/en-us/library/ms173423%28v=sql.105%29.aspx

We recently had this issue at work, what has probably happened is that someone created a table called Table_report under their username (instead of as the DBO - Database Owner). You should try:

Drop Table Table_report

Then rerun your query.

EDIT: You should be able to run the following query to find all the existing tables in the database and find out which username is attached to the table

select ss.name ,st.* from sys.tables st
inner join sys.schemas ss
 on ss.schema_id = st.schema_id
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!