Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

how to insert images in to image table Expand / Collapse
Author
Message
Posted Saturday, February 19, 2011 3:30 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Thursday, June 14, 2012 11:52 PM
Points: 63, Visits: 257
how to insert images in to image table through query


i created one table like..
CREATE TABLE [dbo].[image](
[image2] [varbinary](50) NULL,
[id] [int] NULL
)

GO


i don't know how to insert/retrieve images through query...
Please give some example query..

in my system
MS SQL SERVER 2008 Enterprise Edition.....


Thanks in advance....


SRIHARI(:~
Post #1066764
Posted Saturday, February 19, 2011 4:49 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Thursday, July 17, 2014 8:11 AM
Points: 11, Visits: 897
Try this

insert into image (image2,id)
select Bulkcolumn from openrowset (bulk 'path of image file', single_blob) as picture,1
Post #1066766
Posted Saturday, February 19, 2011 6:33 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Wednesday, June 18, 2014 3:57 AM
Points: 141, Visits: 842
Hi,

My 2c...

1. I am concerned that varbinary(50) may not be sufficient storage space.
2. Depending on usage, you may want to check out FILESTREAM if you are using sql server 2008.

I cannot verify syntax.

Good luck!
Post #1066775
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse