Thanks Will for the script! For anyone else that needs to perform this query through the DNN SQL Window in the Persona bar, here is a set of instructions and modified version that you can run: [code=sql] -- Version to Run the AES corrections in the DNN SQL Window -- Step 0 default - assuming that there is only one Portal and one Hotcakes store instance -- that means that the StoreId would be value 1 -- if not then this will need to be redone for each additional instance --Step 1, run this to confirm no AES value present SELECT * FROM [dbo].[hcc_StoreSettings] WHERE [SettingName] LIKE N'AES%' ORDER BY [SettingName]; -- Step 2, get this value SELECT CAST(LEFT((CONVERT(decimal(30,0),(((RAND()*999999999999)/0.00012345671)*999999999))),16) AS nvarchar(16)) AS NewAESValue -- my example value was 8789607022799839 -- this value will then be placed in the Step 3 scripts -- Step 3, Run these in the DNN SQL Window -- place the NewAESValue number that was generated in Step 2 into these next scripts... here, replace the "8789607022799839" number IF EXISTS (SELECT 1 FROM [dbo].[hcc_StoreSettings] WHERE [SettingName] = N'AESKey' AND [StoreId] = 1) BEGIN UPDATE [dbo].[hcc_StoreSettings] SET [SettingValue] = 8789607022799839 WHERE [SettingName] = N'AESKey' AND [StoreId] = 1; END ELSE BEGIN INSERT INTO [dbo].[hcc_StoreSettings] ([StoreId], [SettingName], [SettingValue]) VALUES (1, N'AESKey', 8789607022799839); END IF EXISTS (SELECT 1 FROM [dbo].[hcc_StoreSettings] WHERE [SettingName] = N'AESInitVector' AND [StoreId] = 1) BEGIN UPDATE [dbo].[hcc_StoreSettings] SET [SettingValue] = 8789607022799839 WHERE [SettingName] = N'AESInitVector' AND [StoreId] = 1; END ELSE BEGIN INSERT INTO [dbo].[hcc_StoreSettings] ([StoreId], [SettingName], [SettingValue]) VALUES (1, N'AESInitVector', 8789607022799839); END -- Step 4, run this query again to see the new values in place SELECT * FROM [dbo].[hcc_StoreSettings] WHERE [SettingName] LIKE N'AES%' ORDER BY [SettingName]; -- you should now see values in the records with the AESKey value entered -- AESInitVector -- AESKey [/code]
|