Solved

Image Default value to varbinary(max)

Posted on 2011-02-22
3
952 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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Introduction                                                 Was the var keyword really only brought out to shorten your syntax? Or have the VB language guys got their way in C#? What type of variable is it? All will be revealed.   Also called…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

762 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now