Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 insert images in array

Author  Topic 

nek
Starting Member

10 Posts

Posted - 2013-01-28 : 03:49:38
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

52326 Posts

Posted - 2013-01-28 : 04:14:44
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

10 Posts

Posted - 2013-01-28 : 04:26:34
thanks a lot !!!
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-01-28 : 05:00:55
welcome

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

Go to Top of Page

nek
Starting Member

10 Posts

Posted - 2013-01-28 : 06:31:00
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

52326 Posts

Posted - 2013-01-28 : 06:40:41
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

10 Posts

Posted - 2013-01-28 : 06:54:03
the test connection is succeded .
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-01-28 : 06:55:45
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

10 Posts

Posted - 2013-01-28 : 07:02:05
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

10 Posts

Posted - 2013-01-28 : 07:41:46
does it help ?
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-01-28 : 08:36:30
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

10 Posts

Posted - 2013-01-28 : 08:42:16
yes , it is the same always .
Go to Top of Page

nek
Starting Member

10 Posts

Posted - 2013-01-29 : 03:42:54
all ok finally .
I updated my sql with sp4 and all play.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-01-29 : 03:47:54
is path a unicode datatype?

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

Go to Top of Page

nek
Starting Member

10 Posts

Posted - 2013-01-30 : 01:23:49
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
   

- Advertisement -