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
 General SQL Server Forums
 New to SQL Server Programming
 Images

Author  Topic 

morietrenatus
Starting Member

2 Posts

Posted - 2013-04-21 : 22:44:30
What is the type of values I have to use to tell the database to store pics?

MuMu88
Aged Yak Warrior

549 Posts

Posted - 2013-04-21 : 22:53:41
Please refer to:
http://msdn.microsoft.com/en-us/library/ms187993.aspx
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-04-22 : 00:51:10
you should be using varbinary. there was a separate datatype called image before but thats deprecated so varbinary(max) is the way to go.

you can use OPENROWSET ..BULK to insert an image in db.

http://www.java2s.com/Tutorial/SQLServer/0100__Data-Types/InsertingorUpdatinganImageFileUsingOPENROWSETandBULK.htm

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

arronlee
Starting Member

12 Posts

Posted - 2013-12-09 : 21:44:21
Hi, morietrenatus.
I have ever tried to
store pics with the help of the following code:

using System.IO;
using System.Drawing.Printing;
using Yiigo.Imaging;
using Yiigo.Imaging.Processing;
using Yiigo.Imaging.Loading;

// Get or create an image to save later.
YiigoImage image = GenerateImage()

Save image to JPG format.
Image.Save("jpgimage.jpg", new JpegEncoder(), null);

/*Save image to PNG format.
Image.Save("pngimage.png", new PngEncoder(), null);

Save image to gif format.
Image.Save("gifimage.gif", new GifEncoder(), null);
*/

Or you can also google it and select a fine imaging tool whose way of processing is simple and fast to help you with the related work. It will be better if it is totally manual and can be customized by users according to our own favors. Remember to check its free trial package first if possible. I hope you success. Good luck.



Best regards,
Arron
Go to Top of Page

badlydressedboy
Starting Member

4 Posts

Posted - 2013-12-11 : 22:09:28
Have you thought of storing the image on the file system and saving the path to it as text?
This will perform very well for you.

---------------------------------------------------------------------------------------------------------------------
Performance Tuning, Server Healthcheck & Monitoring Software: www.minidba.com
Go to Top of Page
   

- Advertisement -