I use this code to save a string in my extended property,
EXEC sp_addextendedproperty @name = N'SampleProperty1', @value = N'SampleValue1'
My question is, can I use that code when saving a binary file like an image?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I suggest you consider storing the image on disk and setting the extended property to be the path/URL to the image. While an extended property in theory could be any data type supported by
SQL_VARIANT(so you could passvarbinarydata), the limit is 8,016 bytes, so unless your images are very simple/tiny they’re going to be truncated and unusable anyway. Another problem with storing them in extended properties is that within SQL Server you can’t really troubleshoot them – you can only show the binary representation, not the image itself, when you use functions likesys.fn_listextendedproperty.