SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 insert images in array
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

nek
Starting Member

Russia
10 Posts

Posted - 01/28/2013 :  03:49:38  Show Profile  Reply with Quote
hello ,

I have the following problem.

I want to insert images in a table .
That I can do with the following code .

INSERT INTO Employees (Id, Photo)
SELECT 11,, BulkColumn
FROM Openrowset( Bulk 'c:\image1.jpg', Single_Blob) as EmployeePicture

I have the id and the images path in an excell file.

How I can open the excell file and combine the functionality
for (i=1;i<2000;i++)
for every id you read insert the photo
i++;


Thanks in advance!!

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

Posted - 01/28/2013 :  04:14:44  Show Profile  Reply with Quote
see a solution eher

http://www.mssqltips.com/sqlservertip/2616/import-multiple-images-to-sql-server-using-ssis/



------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

nek
Starting Member

Russia
10 Posts

Posted - 01/28/2013 :  04:26:34  Show Profile  Reply with Quote
thanks a lot !!!
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

Posted - 01/28/2013 :  05:00:55  Show Profile  Reply with Quote
welcome

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

nek
Starting Member

Russia
10 Posts

Posted - 01/28/2013 :  06:31:00  Show Profile  Reply with Quote
when I am trying to runnit I receive the following error

===================================

Package Validation Error (Package Validation Error)

===================================

Error at Data Flow Task [Flat File Source [9]]: The component locale ID has not been set. Flat file adapters need to have the locale ID on the flat file connection manager set.

Error at Data Flow Task [DTS.Pipeline]: "component "Flat File Source" (9)" failed validation and returned validation status "VS_NEEDSNEWMETADATA".

Error at Data Flow Task [DTS.Pipeline]: One or more component failed validation.

Error at Data Flow Task: There were errors during task validation.

(Microsoft.DataTransformationServices.VsIntegration)

------------------------------
Program Location:

at Microsoft.DataTransformationServices.Project.DataTransformationsPackageDebugger.ValidateAndRunDebugger(Int32 flags, DataWarehouseProjectManager manager, IOutputWindow outputWindow, DataTransformationsProjectConfigurationOptions options)
at Microsoft.DataTransformationServices.Project.DataTransformationsProjectDebugger.LaunchDtsPackage(Int32 launchOptions, ProjectItem startupProjItem, DataTransformationsProjectConfigurationOptions options)
at Microsoft.DataTransformationServices.Project.DataTransformationsProjectDebugger.LaunchActivePackage(Int32 launchOptions)
at Microsoft.DataTransformationServices.Project.DataTransformationsProjectDebugger.LaunchDtsPackage(Int32 launchOptions, DataTransformationsProjectConfigurationOptions options)
at Microsoft.DataTransformationServices.Project.DataTransformationsProjectDebugger.Launch(Int32 launchOptions, DataTransformationsProjectConfigurationOptions options)

Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

Posted - 01/28/2013 :  06:40:41  Show Profile  Reply with Quote
seems like connection manager issue. are you trying to generate connection string through an expression?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

nek
Starting Member

Russia
10 Posts

Posted - 01/28/2013 :  06:54:03  Show Profile  Reply with Quote
the test connection is succeded .
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

Posted - 01/28/2013 :  06:55:45  Show Profile  Reply with Quote
nope...my question is at runtime are you trying to generate connection string using an expression?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

nek
Starting Member

Russia
10 Posts

Posted - 01/28/2013 :  07:02:05  Show Profile  Reply with Quote
Data Source=LISTENER;User ID=sr;Initial Catalog=LOCALPRD;Provider=SQLNCLI.1;Auto Translate=False;

this is the connection string
Go to Top of Page

nek
Starting Member

Russia
10 Posts

Posted - 01/28/2013 :  07:41:46  Show Profile  Reply with Quote
does it help ?
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

Posted - 01/28/2013 :  08:36:30  Show Profile  Reply with Quote
quote:
Originally posted by nek

does it help ?


I was asking whether its the same always?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

nek
Starting Member

Russia
10 Posts

Posted - 01/28/2013 :  08:42:16  Show Profile  Reply with Quote
yes , it is the same always .
Go to Top of Page

nek
Starting Member

Russia
10 Posts

Posted - 01/29/2013 :  03:42:54  Show Profile  Reply with Quote
all ok finally .
I updated my sql with sp4 and all play.

Edited by - nek on 01/29/2013 03:48:35
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

Posted - 01/29/2013 :  03:47:54  Show Profile  Reply with Quote
is path a unicode datatype?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

nek
Starting Member

Russia
10 Posts

Posted - 01/30/2013 :  01:23:49  Show Profile  Reply with Quote
I have another problem to solve.
my paths are containing the symbol "_".

error receiving DTS_E_INDUCEDTRANSFORMFAILUREONERROR

Is there any way to overcome this problem ?
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.11 seconds. Powered By: Snitz Forums 2000