我正在尝试使用 aspnet___regsql 实用程序在我的本地 SQL Express 2008 实例上的数据库中安装所有成员资格表。我可以在 Management Studio 中毫无问题地连接,但是当我尝试在 aspnet_regsql 界面中列出数据库时,我收到一条错误消息:
从 SQL Server 查询数据库名称列表失败。 无效的对象名称“sysdatabases”
我究竟做错了什么?我该如何解决?
(请告诉我有比重新安装更顺畅的方法......:P)
我正在尝试使用 aspnet___regsql 实用程序在我的本地 SQL Express 2008 实例上的数据库中安装所有成员资格表。我可以在 Management Studio 中毫无问题地连接,但是当我尝试在 aspnet_regsql 界面中列出数据库时,我收到一条错误消息:
从 SQL Server 查询数据库名称列表失败。 无效的对象名称“sysdatabases”
我究竟做错了什么?我该如何解决?
(请告诉我有比重新安装更顺畅的方法......:P)
我已经通过绕过图形界面并直接在命令提示符中执行相同的操作来解决问题,并使用标志指定所有选项。它们应该如下所示:
使用 SQL 身份验证连接
C:\>Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_regsql.exe -S myHostingServer -A all -d myDatabase -U myUserID -P myPassword
使用 Windows 身份验证连接
C:\>Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_regsql.exe -S myHostingServer -A all -d myDatabase -E
不同之处在于行末,SQL Auth. 有-U myUsername -P myPassword
同时 Windows Auth。有-E
(为受信任的连接标记)。
If you want to use the graphical interface, you need to make sure the user you are logged in as has the default db in SQL set to 'master' so it can connect directly to the sysdatabases table.
Ensure that in SQL Server Configuration Manager -> SQL Server Network Configuration -> Protocols for YOUR_SQL_SERVER_INSTANCE_NAME is enabled TCP/IP
. NB. for applying this change need to restart YOUR_SQL_SERVER_INSTANCE_NAME
默认情况下,在 Vista 上,计算机上的当前用户不是 SQL Server 2005/2008 上 SysAdmin 的成员。
所以这里是诀窍。
1-从 C:\Program Files\Microsoft SQL Server 2005/2008 打开 Sql Server 外围应用配置工具。
2-当屏幕弹出时,单击添加新管理员。
-on top right make sure that User to provision=Username of the pc
-on your left (Available Privileges) select Member of SQL Server SysAdmin and click on the right arrow (>)
-click ok and you should be ready to go.
My name is Talley Ouro,Developer in Raleigh,NC Blog: http://talleyblogs.blogspot.com/ Email:johnstalley@live.com
This issue is generally caused by leaving "Server" to be your machine name instead of the name of your SQL server instance. It's tricky to figure out because they autofill the text box to your machine name, which is needed but incomplete. This may lead you to think "Server" refers to the computer itself when they really mean SQL server instance. If you are connecting to your local machine you can generally append to their entry with the name of your SQL instance and everything will work as intended
IE LOCALHOST must become LOCALHOST\SQLEXPRESS or whatever you name your box\sqlserver