Page 1 of 1

TI process error

Posted: Thu Sep 16, 2010 1:30 pm
by viswaraju
I have an Issue Loading Data from Csv to SqlServer Using TI
I took CSV as DataSource and created similar table in sql server with varchar(50) for all columns
Here is my Procedure

I tried TI Process and Finally able to load Only Numeric Values Not String Values into Sql Server.
(All Variables are Numeric)
Prolog:
ODBCOpen('SQL_Test','','');

Metadata:
ODBCOUTput('SQL_Test' , 'Truncate Table [ErrorDB].[dbo].[Product]; ');

Data
ODBCOutput( 'SQL_Test', Expand ('Insert INTO [ErrorDB].[dbo].[Product]( Product,ProductName,ProductNumber)
Values ( %V1%, %V2%, %V3%)' ) );

Epilog:

ODBCClose('SQL_Test');

For String am Using ( All Variables are String)
Data :
ODBCOutput( 'SQL_Test', Expand ('Insert INTO [ErrorDB].[dbo].[Product]( Product,ProductName,ProductNumber)
Values ( "%V1%", "%V2%", "%V3%")' ) );

But Its throwing an error always saying cannot insert into table.......xxxxx Values...."xxx","xxx","xxxXX")"

Please let me know what mistake am doing... Its Urgent for me..

thanks and regards

Re: TI process error

Posted: Thu Sep 16, 2010 1:46 pm
by jim wood
Just as a side issue, why Are you using TI to load an SQL table? Wouldn't it make more sense to use DTS/SSIS? After all if further down the line you want execute a TI process you do so from within SQL. There is a section on this in the useful code section. It covers how to execute a TI process from the command line (process or shcedule) which in turn can de kicked off from within SQL.