表隐藏在 SQL Server 数据库中? [英] Table hiding in SQL Server database?

查看:32
本文介绍了表隐藏在 SQL Server 数据库中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我突然将数据传输到表中,我遇到了一个我职业生涯中从未见过的疯狂问题.

I am transferring data into a table all of sudden I went throgh a crazy problem I have never seen in my career.

消息 208,级别 16,状态 1,第 1 行
无效的对象名称dbo.Table_Report".

Msg 208, Level 16, State 1, Line 1
Invalid object name 'dbo.Table_Report'.

然后我尝试创建一个同名的表,但我再次遇到了错误

Then I tried to create a table with same name and again I got fallowing error

消息 2714,级别 16,状态 6,第 2 行
数据库中已经有一个名为Table_Report"的对象.

Msg 2714, Level 16, State 6, Line 2
There is already an object named 'Table_Report' in the database.

出了什么问题,我需要尽快将数据发送到表中,但我无法这样做,至少我无法删除表

What went wrong I need to send data in to table asap but I am unable to do that at least I can't delete the table

无法删除表Table_Report",因为它不存在或您没有权限.

Cannot drop the table 'Table_Report', because it does not exist or you do not have permission.

注意:我拥有数据库的管理员权限.

Note: I have admin rights on the database.

你们能看看出了什么问题吗??

Can you guys look what went wrong??

推荐答案

我们最近在工作中遇到了这个问题,可能发生的事情是有人用他们的用户名(而不是 DBO - 数据库所有者)创建了一个名为 Table_report 的表.你应该试试:

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.

您应该能够运行以下查询以查找数据库中的所有现有表并找出附加到表的用户名

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

这篇关于表隐藏在 SQL Server 数据库中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆