Parimal Patel
Posts: 25
Joined: Wed Jun 01, 2016 3:16 am

Creating SQL Certificate issue

Hi

I am trying to create SQL certificate as part of building database through Scripts, but certificate never created or never throw error during script execution.

USE [master]
GO

CREATE MASTER KEY ENCRYPTION BY PASSWORD = 'wexw23fghrn6e-4L?!';
OPEN MASTER KEY DECRYPTION BY PASSWORD = 'wexw23fghrn6e-4L?!';

CREATE CERTIFICATE MYBOX_SecurityCert WITH SUBJECT = 'SecureTheUserTable';
GO


CREATE SYMMETRIC KEY MYBOX_SecurityKey WITH ALGORITHM = AES_256 ENCRYPTION BY CERTIFICATE MYBOX_SecurityCert;
GO
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Creating SQL Certificate issue

Hello,

Can you please manually run the SQL Script (outside of the installation process) and make sure it successfully executes?

Also, please go to "SQL Databases" page, select your added SQL connection and check its "Log errors to file" option. Then rebuild your setup and install it again. After installation please also send us the .AIP (project file), a verbose log of the installation and the "AI_SQLScripts.log" file (created in the user's Temp folder) to support at advancedinstaller dot com so we can investigate them.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Parimal Patel
Posts: 25
Joined: Wed Jun 01, 2016 3:16 am

Re: Creating SQL Certificate issue

I have found the solution. Its required to remove existing key and certificate before Installer start executing SQL Scripts which create certificate and key.
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Creating SQL Certificate issue

Hello,

I'm glad you solved this. Thank you for sharing the solution with us. Certainly this info will be useful for future users facing with similar scenario.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Parimal Patel
Posts: 25
Joined: Wed Jun 01, 2016 3:16 am

Re: Creating SQL Certificate issue

I have created clean up script to remove existing certificate and Symmetric Keys from master table, before executing script which create new certificate and Symmetric Keys.

Return to “Common Problems”