Add JPGs to SQL DB

EMR 171 Reputation points
2022-01-25T08:09:34.653+00:00

I have an Access db that is bumping up to the 2Gb file size limit due to the JPG pictures embedded as attachments. I have configured SQL on a VM use the Microsoft Access to SQL migration tool but it will not move the JPG pictures into SQL.

I would like to move this db off Access so I don't have to worry about file size ever again. My questions:

  1. How do you add a JPG (database object type?) to a SQL db.
  2. Several friends suggested that instead of placing the JPG files themselves into SQL that I instead place the file path/name into SQL instead (which should work since the JPGs are stored on a network share). Is this possible? If I do go this route, how can I put multiple JPG file paths to one record?

Thank you.

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,654 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Erland Sommarskog 100.8K Reputation points MVP
    2022-01-25T22:59:50.923+00:00
    1. How do you add a JPG (database object type?) to a SQL db.

    Typically through an application. I have some very old and simple sample code here: https://www.sommarskog.se/blobload.txt.

    Several friends suggested that instead of placing the JPG files themselves into SQL that I instead place the file path/name into SQL instead (which should work since the JPGs are stored on a network share). Is this possible? If I do go this route, how can I put multiple JPG file paths to one record?

    You would have to design your tables accordingly.


  2. AmeliaGu-MSFT 13,961 Reputation points Microsoft Vendor
    2022-01-26T03:23:22.487+00:00

    Hi EMR-7475,

    Please also refer to the following articles which might help:
    SQL Server: Storing Images and Photos
    Save Image to Database Table in SQL Server
    Storing images in SQL database vs storing images in seperate folder and using URL image path

    Best Regards,
    Amelia


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments