Friday, March 9, 2012

Is there any way to insert picture to image datatype in sql server 2000 without using fron

Sir,

Is there any way to insert picture to image datatype in sql server 2000 without using front end. If so please let me know.


Thanks in Advance,

Arun.

Hi,

Is there any way to insert picture to image datatype in sql server 2000 without using front end

From your description, I'm not sure what does the front end mean in your question? But I guess that you want to save your images into SqlServer without "choosing the filepath, clicking the save button", right?

If so, I think there's no difference between the way you save the image with front end. Just assign the exact file path to a local variable, read the file into a byte array, and then write your insert statement, save the array object into the image filed in your database.

For reference, see:

http://www.codeproject.com/useritems/Store_images_in_SQL_Serve.asp

Thanks.

|||

Hi,

What i need is, I need to insert picture in sql query analyzer itself,

just like

normal sql query insertion for int datatype is insert tbl(col) values(1);

so, how can i insert for image datatype?

Please let me know how to do.

Thanks in Advance,

Arun.

|||

Hi,

The image actually existed in the File System of your operating system. Before you want to add it to the image field of your database, you shouldconvert the image file to a byte array, that's something must be done.

As you say, you want to execute your insert command in your query analyzer directly, that is to say you have to write the byte array explicitly in your text command, obviously, you can't achieve that. The other way is just passing a byte array to stored procedure, and execute your insert command with the array object. But the work of "locating files and converting types" can't be achieved while just using query analyzer.

Thanks.

No comments:

Post a Comment