Writing a query to store an image file in a SQL Server 2005 table

Tags:
SQL Server 2005
SQL Server Query
SQL Server tables
How would I write a query to store an image file in a SQL Server 2005 table?

Answer Wiki

Thanks. We'll let you know when a new response is added.

I don’t think this can be done with SQL only. An application might be necessary.
Have a look at the following examples:

———–

The easiest way is to write a client app to do it.

If you must do it with T/SQL you can use the BULK INSERT command with the RAW flag to load the data from the image file into a single row of a temp table. Then put the value into a variable with the data type of VARBINARY(MAX) and put that value into your table.

Your best bet is to use a client app to do it though.

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following