The below SQL query can be used to either move documents from user to another, or to update a current user in the case of a username or domain change.
Use with care!!
DECLARE @oldUser NVARCHAR(50) = 'domain\olduser'; DECLARE @newUser NVARCHAR(50) = 'domain\newuser'; -- To find affected records SELECT * FROM userdocs WHERE ActionResponse = -1 AND deleted <> 1 AND IdentityName LIKE '%' + @oldUser + '%' -- Move them to the new user BEGIN TRAN; UPDATE userdocs SET IdentityName = @newUser WHERE ActionResponse = -1 AND deleted <> 1 AND IdentityName LIKE '%' + @oldUser + '%' ROLLBACK TRAN; -- COMMIT TRAN; when doing this for real
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article