sql server 2008 enable sa account

依然范特西╮ 提交于 2019-12-13 07:43:50

问题


I logged into SQL Server 2008 via SQL Server Management Studio using Windows admin account. When I run the command (ALTER LOGIN sa ENABLE) I get the following error.

Cannot alter the login 'sa', because it does not exist or you do not have permission.


回答1:


You account doesn't have permissions. It isn't sysadmin.

CREATE DATABASE requires

Requires CREATE DATABASE, CREATE ANY DATABASE, or ALTER ANY DATABASE permission.

This is (legacy SQL Server 2000 lingo):

  • sysadmin
  • dbcreator

If the account is "end user" consider wrapping the call in a stored procedure to hide the permissiosn escalation

Edit, after question update

sa is always sa; you can't disable it as such

You need to grant some permissions to the Windows account using GRANT




回答2:


Follow the advices in this article: http://blogs.msdn.com/b/dparys/archive/2009/09/17/create-database-permission-denied-in-database-master-my-fix.aspx

EDIT: The whole question changed!



来源:https://stackoverflow.com/questions/6071649/sql-server-2008-enable-sa-account

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