{"id":143,"date":"2011-08-08T09:15:13","date_gmt":"2011-08-08T03:45:13","guid":{"rendered":"https:\/\/blog.binarybits.net\/?p=143"},"modified":"2011-08-08T09:15:13","modified_gmt":"2011-08-08T03:45:13","slug":"resetting-an-sql-server-account-when-there-is-no-access-through-sql-server-authentication","status":"publish","type":"post","link":"https:\/\/blog.binarybits.net\/resetting-an-sql-server-account-when-there-is-no-access-through-sql-server-authentication\/","title":{"rendered":"Resetting an SQL Server account when there is no access through SQL Server Authentication"},"content":{"rendered":"

Scenario:<\/strong><\/p>\n

    \n
  1. SQL Server \u2018sa\u2019 or any user id is locked out.<\/li>\n
  2. User has no access to SQL Server authenitcation.<\/li>\n
  3. Windows Logged in user is part of Windows local Administrators group where the SQL Server is running and has currently logged into the machine.<\/li>\n<\/ol>\n

    Microsoft has removed the functionality of automatically adding the local windows system admin to SQL 2008 Users. The following solutions are workaround to get inside the SQL server by adding a user to SQL Users Table.<\/p>\n

    Note: Since this involves SQLCMD and starting, stopping of SQL Instance the logged in user should be an administrator of that server where the SQL Server is running and both solutions should be run under an elevated command prompt.<\/p>\n

    Solution 1 : (Little difficult Solution. Check Solution 2 for automated script by Microsoft)<\/strong><\/p>\n

    Open command prompt.<\/p>\n