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

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Images
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

morietrenatus
Starting Member

Dominican Republic
2 Posts

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

MuMu88
Aged Yak Warrior

547 Posts

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

visakh16
Very Important crosS Applying yaK Herder

India
52309 Posts

Posted - 04/22/2013 :  00:51:10  Show Profile  Reply with Quote
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

USA
9 Posts

Posted - 12/09/2013 :  21:44:21  Show Profile  Reply with Quote
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

Edited by - arronlee on 12/10/2013 21:34:28
Go to Top of Page

badlydressedboy
Starting Member

4 Posts

Posted - 12/11/2013 :  22:09:28  Show Profile  Reply with Quote
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
  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.08 seconds. Powered By: Snitz Forums 2000