Skip to content

Instantly share code, notes, and snippets.

@fo40225
Created March 18, 2019 09:15
Show Gist options
  • Save fo40225/08454c6c7f79bce8126e95f467dc0f06 to your computer and use it in GitHub Desktop.
Save fo40225/08454c6c7f79bce8126e95f467dc0f06 to your computer and use it in GitHub Desktop.
enable sa login on SQL Server
ALTER LOGIN sa ENABLE ;
GO
--change the password
ALTER LOGIN sa WITH PASSWORD = --'P@ssw0rd' ;
GO
USE [master]
GO
EXEC xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'Software\Microsoft\MSSQLServer\MSSQLServer', N'LoginMode', REG_DWORD, 2
GO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment