I am storing image in SQL server 2008 R2 database in varBinary(max) column named: image1 which is of size 150*150. I have added another column named image2 varBinary(max) and i need to update this column with the same image in image1 but with 70*70 size. Is it possible to do this using sql query.
I have tried to find the query but not getting any clue how to do this. Please let me know if anyone has done this before and how?
I agree with everyone’s points here, but if you really wanted to or had to, you could enable CLR integration on the SQL Server, create an assembly that could resize your image, and then call it from a trigger or proc. Its not very hard. Here a page that describes the process: http://msdn.microsoft.com/en-us/library/ms254498(VS.80).aspx
Basicly to enable CLR on the SQL Server:
Create a c# assembly to resize your image:
Compile the assembly
Load the assembly in the SQL Server:
Create the proc
After that you can call it like a normal proc. For example: