Quantcast
Channel: SQL Server Manageability forum
Viewing all articles
Browse latest Browse all 1519

ALTER LOGIN for SA fails with 15151 error SQL Server 2005

$
0
0

I need to change the password for the SA account on a SQL Server 2005 instance using TSQL.  I can change the password using Management Studio if I select the "Map Credential" option but this needs to be done via an automated process so I have to use TSQL.  SMO isn't viable and I've not tried it since I have instances ranging from SQL Server 7.0 to SQL Server 2012.  The exact error text is:

Msg 15151, Level 15, State 1, Line 1

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

I've tried several different syntactical variations of the ALTER LOGIN command but without success.  It is supporting a commercial application so I can't really afford to experiment with altering server settings.

Can someone offer the correct way to change the SA password via TSQL?



Viewing all articles
Browse latest Browse all 1519

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>