Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Replacing value based on Image Type field

Status
Not open for further replies.

cfrench

Programmer
Mar 3, 2003
23
0
0
US
I have a table that stores images (bmp files) in a field (item.image) as an image type. In enterprise manager, all fields show up as binary.

I have another table that has a field for the picture name (item_ext.picname). The pic name has some bad data in it where a pic name exists for an image that does not.

I would like to create a SQL statement that would look at the image type field and if a picture does not exist, then replace the picname with null. I do not understand the image/binary field well enough to do this. Any suggestions on how this could be completed?

Thank you,
CF
 
Code:
go
insert into northwind.dbo.employees (firstname,lastname,title) values ('Micky','mouse','clown')
select *  from employees where photo is null
that shows the null row... so
Code:
update northwind.dbo.employees set firstname = null where employeeid in (select Employeeud  from employees where photo is null)
would update firstnames to null if no image exists (and a column definition allowed for Nulls - which firstname doesn't)

HTH


Rob
 
The problem is, there are not any true null values in the image fields. Select null does not pull any fields. It seems that even if an actual image isn't present, there is still binary data in the field.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top