I am trying to execute this
CREATE CERTIFICATE [MyCert] FROM BINARY = 0x3082026 ...
It works fine on Sql Server 2014 onwards but on Sql Server 2012, I get a syntax error
Incorrect syntax near '=' Expecting FILE, ID or QUOTED_ID
Manuals appear to suggest it should be ok - unless I'm misunderstanding.
BINARY = asn_encoded_certificate
ASN encoded certificate bytes specified as a binary constant.
Applies to: SQL Server 2012 (11.x) and later.
I am using 11.0.7507.2.
I have also tried EXECing it as dynamic sql and get the same issue.
EDIT:
I installed a new instance of Sql Server 2012 (11.0.7001.0) and created a new database and ran the script against that, and it worked fine.
I had wondered whether because there were other databases with lower compat on the original 2012 server, there was a "lowest common denom" as to which sql parser was being invoked. But no! I also restored a compat level 90 db onto the new server and my original script still worked.