Documented CREATE CERTIFICATE with FORMAT = 'PFX' example, gives syntax error

Chitacu, A. (Adrian) 0 Reputation points
2024-11-21T10:14:57.5333333+00:00

Hello,

I'm trying to use the CREATE CERTIFICATE command in SQL SERVER 2019 but I get the error: Incorrect syntax near '='.

Using the example: E. Creating a certificate from a PFX file
CREATE CERTIFICATE Shipping04

FROM FILE = 'c:\storedcerts\shipping04cert.pfx'

WITH 

FORMAT = 'PFX', 

PRIVATE KEY (

    DECRYPTION BY PASSWORD = '9n34khUbhk$w4ecJH5gh'

);  

Documented here: https://learn.microsoft.com/en-us/sql/t-sql/statements/create-certificate-transact-sql?view=sql-server-ver15

What is the correct syntax to CREATE CERTIFICATE from pfx?

Thanks,

Adrian

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
14,060 questions
0 comments No comments
{count} votes

Accepted answer
  1. Olaf Helper 45,126 Reputation points
    2024-11-21T10:24:21.46+00:00

    What is the correct syntax to CREATE CERTIFICATE from pfx?

    The syntax is correct, your SQL Server version "is wrong".

    Haven't you read

    WITH FORMAT = 'PFX' Applies to: SQL Server 2022 (16.x) and later

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.