Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8912011
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T04:05:40+00:00 2026-06-15T04:05:40+00:00

I am storing image in SQL server 2008 R2 database in varBinary(max) column named:

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T04:05:41+00:00Added an answer on June 15, 2026 at 4:05 am

    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:

    sp_configure 'clr enabled', 1
    GO
    RECONFIGURE
    GO
    

    Create a c# assembly to resize your image:

    using System;
    using System.Data;
    using Microsoft.SqlServer.Server;
    using System.Data.SqlTypes;
    
    public class ResizeImageProc
    {
        [Microsoft.SqlServer.Server.SqlProcedure]
        public static void ResizeImage(int ImageID, int width, int height)
        {
           //TODO: ResizeImage Code
        }
    }
    

    Compile the assembly

    csc /target:library ResizeImageProc.cs 
    

    Load the assembly in the SQL Server:

    CREATE ASSEMBLY ResizeImageAssembly from 'c:\ResizeImageProc.dll' WITH PERMISSION_SET = SAFE
    

    Create the proc

    CREATE PROCEDURE ResizeImage AS EXTERNAL NAME ResizeImageAssembly.ResizeImageProc.ResizeImage
    

    After that you can call it like a normal proc. For example:

    EXEC ResizeImage(1,800,600)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a SQL Server 2008-R2 database that has a table that is storing
I have a table in SQL server 2008 R2 where I am storing values
I have a SQL Server database, and I want to store in image type
I have some images (png's and jpg's mostly) that I'm storing in SQL Server
I have a view which contains a users id and an image column. Here's
Kindly help me with the following : I am using SQL database server 2008
I am connecting to my MS SQL server (2008) where I have stored JPG's
I have a column of JSON strings in my table, I'm using SQL Server
I am currently reading an image from an SQL Server database as byte[]. I
I have written code to insert an Image in SQL server but it throws

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.