Solved

Image Default value to varbinary(max)

Posted on 2011-02-22
3
954 Views
Last Modified: 2012-06-27
Hello, i want to have an image as default value in my varbinary(max) column.

But the data in a varbinary(max) is encrypted <binary data> :S
0
Comment
Question by:bskyum
  • 2
3 Comments
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 250 total points
ID: 34958702
I would, for that, create a row that holds the default value, and "on insert" trigger, update the current row with the value of that default "image".
<binary data> is btw not encrypted, but the interface does not display "binary data", as it cannot know that the data is actually an image.
0
 
LVL 14

Assisted Solution

by:robasta
robasta earned 250 total points
ID: 34958709
That would be duplicating the default image. I would suggest that you do a check when you get the image, if the Image (varbinary field) is empty, get the default image from somewhere else (file system or a particular row in db).

The other advantage is that you can cache the 'default' image and avoid getting the same data from the database.
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 34958742
good food for thought, robasta.
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Error in script 11 57
Counting connections to SQL Server through C# 3 33
Video Player 11 23
application restarter  - for an exe that hangs 9 27
Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question