Skip to main content
Announcements
A fresh, new look for the Data Integration & Quality forums and navigation! Read more about what's changed.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Import from MS SQL Server. Export to CSV.

Hi all,
I am trying to setup Talend Open Studio for Data integration for the below purpose;
Import data from a MS SQL Server table, and export this data into a .csv file.
I am running:
Windows XP 32bit
MS SQL Server 2005 Express
Talend Open Studio for Data Integration 5.0.1
I have successfully setup a connection to the SQL Server and have created a schema for the table I am trying to retrieve data from however the .csv file I have specified is empty and I am receiving this error:
Exception in component tMSSqlInput_1
java.lang.NullPointerException
at ms_sql_server_etl.data_export_0_1.Data_Export.tMSSqlInput_1Process(Data_Export.java:556)
at ms_sql_server_etl.data_export_0_1.Data_Export.runJobInTOS(Data_Export.java:956)
at ms_sql_server_etl.data_export_0_1.Data_Export.main(Data_Export.java:824)
In my job designer I have:
tMSSqlInput_1
Running the query:
"SELECT dbo.\"Stock Group\".\"ID\",
dbo.\"Stock Group\".Code,
dbo.\"Stock Group\".Description,
dbo.\"Stock Group\".\"tc ho/bo delete flag\",
dbo.\"Stock Group\".deleted
FROM dbo.\"Stock Group\""
With it set to use an existing connection, the schema set to the repository and the table name set to: "Stock Group"
I have this connected to a tFileOutputMSDelimited_1
Any help would be greatly appreciated!
Sincerely,
Robert
Labels (3)
3 Replies
Anonymous
Not applicable
Author

Hi Robert
Welcome to Talend Community!
Here are some advices.
No.1 : Use tFileOutputDelimited instead of tFileOutputMSDelimited.
No.2 : Use Metadata->Db Connections to retrieve schema and query, which is more convenient.
No.3 : The query above is wrong. There is no need to type \" here.
Regards,
Pedro
Anonymous
Not applicable
Author

RSoppa,
What I usually do when making queries for my input component is create them in SQL server and make sure they are working there.
When your just select all columns of a table you can do as pedro suggested by retrieving the query and the schema. In that case you won't even have to modify anything about the query.
Regards
Anonymous
Not applicable
Author

RSoppa,
What I usually do when making queries for my input component is create them in SQL server and make sure they are working there.
When your just select all columns of a table you can do as pedro suggested by retrieving the query and the schema. In that case you won't even have to modify anything about the query.
Regards

Sorry, I should have mentioned that I was using a simply query to test the functionality of Talend for my purposes. I have a significantly more complex query that I need to execute.
Pedro: What do you mean by using the Metadata > Db Connections? I have retrieved the Schema for the table 'Stock Group' and I'm loading it from the Repository. I have changed to using the tFileOutputDelimited_1 and changed the query to remove the '/' from the query which were inserted when I selected 'Guess Query'. When I remove the '/' I receive even more errors! Changing to the other file output has not removed my original errors either.
I am very new to this program, sorry if what I'm asking is very basic!