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
 add image to database column

Author  Topic 

sqllover
Constraint Violating Yak Guru

338 Posts

Posted - 2009-03-31 : 23:37:24
Hi,

i have two columns in my table.
Emp

____________
ID - int
img - Image
actually the image which ia mgoing to refer is in c:/images folder.

so if my value is ID is 1 then i ahve to insert some image from c:/images folder to my table image column.

like this i need to. so can any one please help me in ths. how to insert image from physical path.

ashishashish
Constraint Violating Yak Guru

408 Posts

Posted - 2009-04-01 : 00:08:53
INSERT INTO [dbo].[Emp]([Image])
SELECT * FROM
OPENROWSET(BULK N'c:/images folder\iamgename.jpg', SINGLE_BLOB) AS Document
GO

May Be like this you want,,,
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-04-01 : 13:38:56
if sql 2005 & above use varbinary(max) instead of image as image is deprecated
Go to Top of Page
   

- Advertisement -