-
Apr 3rd, 2013, 11:34 PM
#1
Thread Starter
Lively Member
how to store and retrieve an image to an sql image field
Hi All,
I want to store an image to SQL Server 2005. I don't wan't to store the image path, i wanna store the image as it is. If anybody has an idead please share it with me.
-
Apr 4th, 2013, 12:32 AM
#2
Re: how to store and retrieve an image to an sql image field
Have a look at this which is from RhinoBull, it is in Access but it should be usable with SQL Server also.
-
Apr 4th, 2013, 12:44 AM
#3
Thread Starter
Lively Member
Re: how to store and retrieve an image to an sql image field
Thanks for the reply dee-u.
But i've a question. in that eg u used OLE Data as datatype to store the image. In SQL what Datatype should i use for this. And, if i use image or varbinary(MAX) datatype will this work correctly?
-
Apr 4th, 2013, 01:19 AM
#4
Re: how to store and retrieve an image to an sql image field
Yes, I believe that is what you should use in SQL Server now.
-
Apr 4th, 2013, 01:27 AM
#5
Re: how to store and retrieve an image to an sql image field
Don't say "SQL" if you mean "SQL Server" since nearly every RDBMS uses SQL queries.
From the MSDN Library CD (online Help) that comes with VB6:
Intermediate Microsoft Jet SQL for Access 2000
The OLEOBJECT data types
The OLEOBJECT data types are used to store large binary objects such as Word documents or Excel spreadsheets. The number of bytes is not specified, and the maximum size is 2.14 gigabytes. Its synonyms are IMAGE, LONGBINARY, GENERAL, and OLEOBJECT.
I can't find a table mapping Jet data types to SQL Server data types right now but the odds are very good that you have chosen the right type.
-
Apr 4th, 2013, 01:46 AM
#6
Re: how to store and retrieve an image to an sql image field
According to this: http://technet.microsoft.com/en-us/l.../cc917602.aspx the equivalent to 'OLE Object' in Access is 'Image' in SQL Server. (as Dilettante's Post suggests)
-
Apr 4th, 2013, 01:53 AM
#7
Re: how to store and retrieve an image to an sql image field
Originally Posted by Doogle
According to MSDN, image data types will be removed in a future version of Microsoft SQL Server so its safer to use varbinary(MAX).
-
Apr 4th, 2013, 02:03 AM
#8
Re: how to store and retrieve an image to an sql image field
That's good of them ! I should have noted the Date on the link I posted (2004).
So all those poor souls who heeded the 'advice' in 2004 are going to be stuffed if / when they want to migrate to a future version of SQL Server. Do Microsoft have any idea of how the real world works?
I'm struggling to think why they'd ever want to remove a data type once it's been established - is there some sort of major overhead in 'supporting' it from their point of view?
-
Apr 4th, 2013, 02:09 AM
#9
Re: how to store and retrieve an image to an sql image field
I'm guessing some of those "types" are just source-level synonyms for each other anyway just as in Jet.
The odds of the deprecated synonyms actually going away is probably small. Still, you never know. Microsoft isn't the company it used to be.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|