Solved

Problem with restoring the SQL database

After a backup on a separate PC and restoring the SQL database on another PC, it returns an error. Please help me!

Comments (1)

photo
1

Dear Влад,

We apologize for the delay in answering your post. We have this script that you may use to query the current users:

SELECT CA.objName, dbo.fnBA_DB_BlobToClob(CA.objContentResolved)

FROM BABIZAGICATALOG CA

WHERE CA.objTypeName = 'MetadataAuthorizationUserJson';

* Then take ownership of one of them replacing the user name and domain with the following script (you will have to replace the keyworkds olddomain, newdomain, olduser, newuser):

DECLARE @ChangeSetId INT = (SELECT ChangeSetId from BABIZAGICATALOG WHERE objType = 121) + 1

UPDATE BABIZAGICATALOG SET ChangeSetId = @ChangeSetId WHERE objType = 121

UPDATE CA SET objContentResolved = dbo.fnBA_DB_ClobToBlob(REPLACE(REPLACE(dbo.fnBA_DB_BlobToClob(CA.objContentResolved), 'olduser', 'newuser'), 'olddomain', 'newdomain')), objName = 'newuser', ChangeSetId = @ChangeSetId

FROM BABIZAGICATALOG CA

WHERE CA.objTypeName = 'MetadataAuthorizationUserJson'

AND CA.objName = 'olduser';

Let us know if this helps you with your issue or if you need further help.

Kind regards,

Laura G