Visual Studio SQL Server Project Create Certificate
CREATE CERTIFICATE [MyCert]
FROM BINARY = 0x1234....
WITH PRIVATE KEY (BINARY = 0x1234..., DECRYPTION BY PASSWORD='Pass1',ENCRYPTION BY PASSWORD='Pass2');
I get the following Visual Studio compiler error : SQL46005: Expected EXECUTABLE but encountered BINARY instead.
This syntax works on SQL 2012 and I have the database project targeting the correct version.

Upvotes: 3
<=-=Dec 28 2016 7:28PM=-=>Thank you for submitting this feedback. We have reproduced the behavior for certificate objects that you’ve described and are now investigating the appropriate resolution. We will update this Connect item as additional information is available.
Thanks again!
Steven Green
SQL Server tools team
I have this issue as well. It makes creating a homogenous test environment amongst our development team more difficult.
<=-=Feb 21 2017 12:09PM=-=>5 comments
-
Anders Eklund commented
Agree and I got the same problem. This should have been fixed by now. But a workaround is to wrap the statement in dynamic SQL and execute like...
EXECUTE sp_executesql @dyncertstmt;
-
Solomon Rutzky commented
Please see (and vote for) related issue regarding Asymmetric Keys:
"Allow Asymmetric Key to be created from binary hex bytes string just like CREATE CERTIFICATE" ( https://feedback.azure.com/forums/908035-sql-server/suggestions/32896978-allow-asymmetric-key-to-be-created-from-binary-hex?tracking_code=59a149c86262ef9e840b5b17bcee2c89 )
Take care,
Solomon...
https://SqlQuantumLift.com/
https://SqlQuantumLeap.com/
https://SQLsharp.com/ -
Eitan Blumin commented
Isn't the TSQL Parser Service supposed to be compatible with SQL 2012?
It's very bizarre, then, that this issue still wasn't solved after so long, considering the syntax works in SQL 2012.This makes SSDT project deployment very painful.
Please fix! -
Anthony commented
This hasn't been fixed in Visual Studio 2019. When is this going to be fixed?
-
Jens Damm commented
This issue is over two years old and is still not fixed (just stumbled upon it in the latest Visual Studio 2018 with the latest SSDT installed)...