SQL schemas - dbo.<tablename> has to go

。_饼干妹妹 提交于 2020-01-06 10:38:13

问题


I'm still pretty new to SQL and all the related issues that resemble mine really don't clarify anything. My problem is this: We have a widely used piece of administration software, which can either use MDB or SQL. Some time ago, I migrated the MDB to a new SQL server instance, this setup has been running smoothly for some time now. I no longer had some of the drawbacks that an Access database has.

Now, a new piece of software we're using connects to that same database to append data. It can also be set to either MDB or SQL mode. The problem is, when that software solution is set to SQL mode, it can't find the tables because they all have dbo. as a prefix. Instead of tbl(tablename) it now reads dbo.tbl(tablename) in the management studio. If I convert the database back to MDB format, the tables read normally and this new software solution can read the tables fine in MDB mode. This is frustrating me as every thread on this kind of explains some stuff about SQL schemas and ownership but it's all pretty vague. I think if I can remove the dbo. prefix from all the objects in the database, this new software solution can find the tables again, and the main administrative software should too.

Please note that I'm a novice as far as SQL goes


回答1:


Every table has to belong to a schema in SQL Server; a legacy assumption is that dbo is the default, which it sounds like your migration script assigned all of the tables to. You need to make sure that the account which is connecting to your SQL database has access to the dbo schema (typically it will own that schema).



来源:https://stackoverflow.com/questions/22481820/sql-schemas-dbo-tablename-has-to-go

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!