Inserting an Image into SQL server database directly from ManagementStudio   Leave a comment


Syntax: 

insert into <tablename>(<column-name>) ( select * from openrowset

(bulk N’<path of image>’,single_blob) as <column-name> )  

 —————————————————

eg:

create table picture (photo image)

 —————-

insert into picture(photo) ( select * from openrowset

(bulk N’e:\prash\sunrise.jpg’,single_blob) as photo )

About these ads

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: