sql2000数据库导入到sql2005的兼容性问题
二月 15th, 2009
今天把sql2000中的northwind库使用附加的方式导入到sql2005中,发现其他都正常,就是diagram功能无法使用。提示
------------------------------
Database diagram support objects cannot be installed because this database does not have a valid owner. To continue, first use the Files page of the Database Properties dialog box or the ALTER AUTHORIZATION statement to set the database owner to a valid login, then add the database diagram support objects.
------------------------------
按提示做了一下,发现并不能解决问题。查阅了一下资料,原来是一个兼容性的问题。在2005中,引入了一个Diagram Support Objects的概念,用来处理Diagram,使用附加或还原的方式时,如果数据库的onwer和原来实例的登录名不一致时就会发生这样的错误。
解决方法,不算复杂:
在 SQL Server Management Studio 中如下处理
1. database右键菜单选择properties
2. 选择Options选项页
3. 将"Compatibility Level" 设置为 "SQL Server 2005(90)"
4. 选择Files选项页
5. 将owner修改为"sa"
6. 搞定