Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2012 Forums
 SQL Server Administration (2012)
 Can Scanned Documents Be Stored in Database

Author  Topic 

jbates99
Constraint Violating Yak Guru

396 Posts

Posted - 2014-03-27 : 23:17:05
Hi, can a scanned document image be stored in a SQl Server 2012 database? Most systems typically store the path to the location the file resides at. But can the scanned image itself reside with the database?
Thanks, Jack

dontulasrini
Starting Member

7 Posts

Posted - 2014-03-28 : 00:22:40
yes its possible to store complete image file into database
you have to convert the image file into byte format
datatype is image

hear is the code i wrote in vb.net
Dim arrayImage() As Byte
Dim ms As New MemoryStream
Me.PictureBox1.Image.Save(ms, Me.PictureBox1.Image.RawFormat.Jpeg)
arrayImage = ms.GetBuffer
ms.Close() ' Closes the Memory Stream

Go to Top of Page

jbates99
Constraint Violating Yak Guru

396 Posts

Posted - 2014-03-28 : 08:42:37
Thanks for your reply.
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2014-03-28 : 12:39:17
The image data type is deprecated in SQL Server, use varbinary(max) instead.
Go to Top of Page
   

- Advertisement -