How to import images from folder files to SQL server?How can we see full image on SQL server.

Anandhswarupp 85 Reputation points
2024-07-06T12:38:50.8666667+00:00

How to import images from folder files to SQL server?How can we see full image on SQL server.

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

3 answers

Sort by: Most helpful
  1. Erland Sommarskog 111.1K Reputation points MVP
    2024-07-06T12:47:41.6833333+00:00

    First of all, you cannot see any images in (or on) SQL Server, of the simple reason that SQL Server does not have a user interface. You can store images in SQL Server, but you need an application to display them.

    Typically, you would also use an application to load the images into SQL Server, just like you would store any other data. Although, there are a few more variations for LOB data. You can store it as Filestream, or you can even use a FileTable. In both cases, the images are stored as files. With Filestream in general, that is still entirely within the database and not visible elsewhere. With FileTable, you can access the files through the Windows Explorer or similar means.

    I happen to have a very old sample on how to load blobs with VB6 here: https://www.sommarskog.se/blobload.txt

    0 comments No comments

  2. Olaf Helper 44,501 Reputation points
    2024-07-07T04:55:37.5033333+00:00

    How often do you want to ask the same question again&again and why do you don't read the answers in on post's?

    https://learn.microsoft.com/en-us/answers/questions/1791947/how-to-move-images-or-symbols-from-folder-to-sql-s

    0 comments No comments

  3. MikeyQiaoMSFT-0444 3,025 Reputation points
    2024-07-08T08:40:17.27+00:00

    Hi,Anandhswarupp

    How can we see full image on SQL server

    SQL Server is just a relational database, and since image files are stored in SQL Server as file streams or binary data, you cannot directly preview image files through SQL Server.

    To preview image files stored in SQL Server, you need to extract the image data using an application, for example, with C# or an ASP.NET Web application, and then display the images within the application.

    Use the OPENROWSET function combined with the BULK option to import the file into SQL Server.

    Refer tohttps://www.mssqltips.com/sqlservertip/4963/simple-image-import-and-export-using-tsql-for-sql-server/

    As Erland mentioned, FILESTREAM is a more efficient way to store large files in SQL Server.

    If you have any questions about the answer, please feel free to add a comment, and we will respond to you promptly.

    Best Regards,

    Mikey Qiao


    If you're satisfied with the answer, don't forget to "Accept it," as this will help others who have similar questions to yours.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.