SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
Register Now and get your question answered!
Save Password
Forgot your Password?

 All Forums
 SQL Server 2012 Forums
 SQL Server Administration (2012)
 Can Scanned Documents Be Stored in Database
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Constraint Violating Yak Guru

379 Posts

Posted - 03/27/2014 :  23:17:05  Show Profile  Reply with Quote
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

Starting Member

7 Posts

Posted - 03/28/2014 :  00:22:40  Show Profile  Reply with Quote
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

Constraint Violating Yak Guru

379 Posts

Posted - 03/28/2014 :  08:42:37  Show Profile  Reply with Quote
Thanks for your reply.
Go to Top of Page

Most Valuable Yak

15663 Posts

Posted - 03/28/2014 :  12:39:17  Show Profile  Visit robvolk's Homepage  Reply with Quote
The image data type is deprecated in SQL Server, use varbinary(max) instead.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000