Question

I understand this should be searched online. I did but most of the links point to SSMS and UI for doing this. I am relying on Visual Studio 2012 SSDT and self-typed SQL query.

Please help me with below SQL command to set sa password.

 CREATE LOGIN [sa]
 WITH PASSWORD = N'MyPassword', DEFAULT_LANGUAGE = [us_english];
 GO 

 ALTER LOGIN [sa] ENABLE
Était-ce utile?

La solution

It really helps if you post whatever error you are getting.

sa should already exist so you can't create it again. You can change it's password with this if you have sufficient privileges. If you have an error post it.

ALTER LOGIN sa WITH PASSWORD=N'NewPassword'
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top