[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

02/13/2009 at 12:09PM PST, ID: 24142297
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.1

Microsoft SQL Server 2005 - Procdure to import images as binary data to columns in a table

Asked by mkarnofel in SQL Server 2005

Tags: Microsoft SQL Server 2005

I'm attempting to write a procedure that will allow me to import images as binary data to columns in a table.

Currently the table contains several columns relating to information about each product.  Additionally, the table has a columns called:

FileName (nvarchar(255))
WebImageFull (varbinary(max))
WebImageThumb (varbinary(max))

I need a procedure that will spin thorugh the table, look up the filename from the 'FileName' column and then import the images into the 'WebImageFull' and 'WebImageThumb' columns respectivley.

The images are stored in the file system at the following locations:

Full size - 'C:\images\fabrics\full_180_180\'
Thumb size - 'C:\images\fabrics\thumb_50_50\'

I began writing the query, but got hung up and decided to post it here.  Any help would be appreciated.  Here is my code so far:


1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
DECLARE @FileName varchar(80)
DECLARE	@imgStringFull varchar(80)
DECLARE	@imgStringThumb varchar(80)
DECLARE @insertString varchar(3000)
 
 
SET @FileName = filename 
 
WHILE @FileName <> ''
 
BEGIN
 
SET @imgStringFull = 'C:\images\fabrics\full_180_180\' + @FileName
SET @imgStringThumb = 'C:\images\fabrics\thumb_50_50\' + @FileName
 
SET @insertString = 'UPDATE tmpImageTable SET WebImageFull = (SELECT BulkColumn FROM OPENROWSET(BULK ' + @imgStringFull + ', SINGLE_BLOB) AS x), WebImageThumb = (SELECT BulkColumn FROM OPENROWSET(BULK ' + @imgStringThumb + ', SINGLE_BLOB) AS x_1)'
 
EXEC(@insertString)
 
END
 
GO
[+][-]02/13/09 12:44 PM, ID: 23637133

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/17/09 11:16 AM, ID: 23663072

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/17/09 12:08 PM, ID: 23663593

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/17/09 12:26 PM, ID: 23663795

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/17/09 01:34 PM, ID: 23664476

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: SQL Server 2005
Tags: Microsoft SQL Server 2005
Sign Up Now!
Solution Provided By: maradam
Participating Experts: 1
Solution Grade: A
 
 
[+][-]02/18/09 11:06 AM, ID: 23673691

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20090824-EE-VQP-74 - Hierarchy / EE_QW_3_20080625