CFF KB - Carrz-Fox-Fire Promotions Knowledge Base
CFF KB is all about 1 thing: The Sharing of Knowledge and the Power we gain from it.Knowledge Base
- Breadrumbs:
SSMS Key not valid for use in specified state
- Article ID:
3238 - Date Created
Wednesday, January 12, 2022 - Last Updated
Sunday, April 30, 2023 - This Article Has been Viewed
603 times - Short Desc
SQL Server Management Studio gives an error Key not valid for use in specified state. - Details
Loading SQL Server Management Studio on a system with the RegSrvr.xml file from a previous installation can cause the error "Key not valid for use in specified state" when trying to read from an encrypted password in the XML file. - Recreate Issue
In the RegSrvr.xml, you will have the following entries for every server you have attached to SQL Server Management Studio or SSMS.
ConnectionStringWithEncryptedPassword
These are the encrypted passwords for your SQL Server Instances attached to SSMS. - Resolve Issue
This article describes two methods of doing the same thing.
Option #1 was added on 4/30/2023 in correspondence with a video that will soon be uploaded to our YouTube channel. (Link will be posted shortly.)
Option #1 is the quicker way of performing this action.
Some changes have also been made to the original instructions as well.)
There are two locations the RegSrvr.xml file will be.
Option #1
Location #1:
C:\Users\{user}\AppData\Roaming\Microsoft\SQL Server Management Studio\RegSrvr.xml
Open the file in Notepad or Notepad++ or another.
Perform a search and remove the lined sections with the worded phrase, [ConnectionStringWithEncryptedPassword] from location #1 above.
(Do not edit the copy in location #2 as it is a template for location #1)
Location #2:
C:\Users\{user}\AppData\Roaming\Microsoft\Microsoft SQL Server\140\Tools\Shell\RegSrvr.xml
---------------------------
Option #2 (Quicker and without the file editing.)
Close SSMS
In Location #1, change the name of the file.
Leave the file in Location #2, as it is a template for the file in Location #1.
Load SSMS again after changing the #1 file, and a new file will be created.
Choose [View]
Then choose [Registered Servers]
Expand [Database Engine]
Then Expand [Local Server Groups]
Next, Right-click on each of the Servers and select [Properties]
When the Dialog opens, type in the Username and Password.
Next, click on [Test]
If it is a good connection, you will receive the following message.
Edit Server Registration Properties
------------------------------
The connection was tested successfully.
------------------------------
After receiving the above message, click the check box beside [Remember password].
Then click [Save]
Perform the above on each Registered Server until you have completed your list.
At the moment, there is no other workaround.
I read and tested what one person on Stack Exchange stated by taking a new password and copying that password, and paste it in place of the old passwords that are the same.
This is FALSE. I tested it and received the same error as this KB Article describes.
Share With Friends (Updated 6-8-2010)
Recent Articles
All Topics
- Coming Soon - Knowledge Exchange
Trending Articles
- Microsoft VBScript runtime error '800a0046' Permission denied FileSystemObject 24694
- Microsoft OLE DB Provider for SQL Server error '80040e57' String or binary data would be truncated. or The field is too small to accept the amount of data you attempted to add. Try inserting or pasting less data. 21297
- ADODB.Parameters error '800a0e7c' Parameter object is improperly defined 19544
- After Effects warning: Audio conforming failed for the following file .cfa. Perhaps due to disk space 17785
- The backup set holds a backup of a database other than the existing 16825