Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Storing a certificate file in SQL server table

Where can I find information on storing a certificate ".cer" and "pfx" in a SQL Server table?

Can I just store it as a string or does this need to be saved as binary data?

like image 918
Saif Khan Avatar asked Aug 29 '26 18:08

Saif Khan


1 Answers

Just store as varbinary(max) (You can store anything in that upto 2GB-1 bytes)

Edit: to qualify the slight flippancy, the fact it is a certificate is irrelevant to SQL Server like it won't recognise a Word document or PDF as such: it's all binary data

like image 170
gbn Avatar answered Aug 31 '26 06:08

gbn