Tip of the Week #194 – Copy User Personalization
Here’s a handy tip from Catalin Dumitru of the PrintVis Technical Team.
When a company’s more senior user has spent time customizing his/her navigation pane, there is no need for a newer user on the same team to spend a lot of time on personalizing their own navigation pane.
They can just copy it from the other user and make some minor tweaks where necessary, for example if there is a filter by the User ID that needs to be changed to the new user’s ID.
Use the script below if you want to copy the personalization from a different user so that you have the same buttons and lists with the same filters on the navigation pane.
#Please replace DatabaseName with the name of the database from where you want to copy the personalization
#Please replace User1 and User2 with the User Name of the users you want to copy the personalization from and to respectively.
DECLARE @sourceuser uniqueidentifier
DECLARE @targetuser uniqueidentifier
— Find Security ID of Source user
SELECT @sourceuser = [User Security ID] FROM [DatabaseName].[dbo].[User] WHERE [User Name] = ‘User1’
— Find Security ID of Target user
SELECT @targetuser = [User Security ID] FROM [DatabaseName].[dbo].[User] WHERE [User Name] = ‘User2’
— Copy Personalization for certain pages
INSERT INTO [DatabaseName].[dbo].[User Metadata]
,[Page Metadata Delta])
,TabB.[Page Metadata Delta]
FROM [DatabaseName].[dbo].[User Metadata] TabB
WHERE TabB.[User SID] = @sourceuser
AND TabB.[Page ID] >= 51000 — Pages greater then or equal to 51000
AND TabB.[Page ID] <= 99999 — and Pages smaller or equal to 99999
Thank you Catalin!