-1

During some testing I applied SID value 0x01050000000000051500000085E77E2F11C35F7307E53B2B531D0200 of a system account received from SUSER_SIDfunction to User Mapping of a certain Login object in SSMS. Now based on that I cannot get rid of it as I keep getting an error message Value was either too large or too small for a UInt64 no matter what I enter or erase. I would appreciate if somebody would know how to get rid of a certain User Mapping either via UI or code specially when I encountered such an error message, thank you

enter image description here

Tomas Gryzbon
  • 57
  • 2
  • 11
  • Please update your question with the sode executed. It's impossible to understand what do you mean by "I applied SID value to User Mapping of a certain Login". You can create user wuth sid only for contained users of for users without login, in any case there cannot be corresponding logi, so what was your code? – sepupic Feb 22 '18 at 11:03
  • There was no code included. The change was done in SSMS by connecting to a server Security/Logins and there added SID as a value to a User attribute in User Mapping tab. – Tomas Gryzbon Feb 22 '18 at 11:08
  • Ok, describe with the words what was done. Did you open properties of existing SQL Server user and change its short sid with this Windows login sid? – sepupic Feb 22 '18 at 11:13
  • I tried to do this and there is NO property "sid" exposed to modify. This is because sid is assigned at the moment when user is created and it's not YOU to decide it if user is created from login. What type of user it was? SQL Server user with login, user with password, user without login? – sepupic Feb 22 '18 at 11:16
  • I opened properties of an existing User went to User Mapping tab and for one mapping I adjusted attribute User by entering SID received from SUSER_SID function and then the error message explained in my question started displaying without an option to change it back – Tomas Gryzbon Feb 22 '18 at 11:26
  • There is NO user mapping tab in user properties because user cannot be mapped. Are you talking about LOGIN? There is User Mapping for login because login is mapped to users, but where did you find sid there? Why don't you update your question with the picture? – sepupic Feb 22 '18 at 12:43

1 Answers1

1

Your actions were: Open login properties of some windows login Changing the corresponding user for some database to sid (why on the erth did you map the login to the user named as sid???)

This corresponds to the following code:

alter user... with name = [0x01050000000000051500000085E77E2F11C35F7307E53B2B531D0200];

Now you want to do the inverse action, so you need to execute this code:

use CDR_MDS;
alter user [0x01050000000000051500000085E77E2F11C35F7307E53B2B531D0200] with name = NAME=[GROUP\gg ORG RAACO MS BI Team];
sepupic
  • 7,849
  • 1
  • 7
  • 16
  • Thank you, that helped me changing it from SID and then eventually being able to disable this User Mapping – Tomas Gryzbon Feb 23 '18 at 12:54
  • As behind user object is a specific SID I wanted to try whether that would help me with my specific problem, anyway I did not expect that SSMS will not let me change it afterwards other way than via code – Tomas Gryzbon Feb 23 '18 at 13:01
  • @Tomas Gryzbon, every action you make in SSMS produce some code that you can see clicking on "script" button in the left upper corner of the corresponding dialog window. Sometimes SSMS does some other things prior to produce the code and when smth goes wrong you can see some error that is NOT server error. In this case you should execute the code you need directly in query Window. In your case the error was studio error, not server error (mscorlib), so all you need was to execute the code manually – sepupic Feb 23 '18 at 13:37
  • >>>I wanted to try whether that would help me with my specific problem<<< If you did not resolve your problem, can you explain it now please? I love security issues :) – sepupic Feb 23 '18 at 13:39