Copy selected columns from source table to destination table
Hi,
I am playing around with TOS DI and finding my feet a little, it seems like a really good product.
What I am trying to do is copy all the columns apart from the identity column from one table to a renamed copy of the exact table in MS SQL Server.
In TOS my job I have a tMSSqlInput that is correctly configured to the DB and SQL query is good. This is connected to a tMap which in turn is connected to a tMSSqlOutput which is pointing at the destination table. What I am finding confusing is when I double click my tMap object to go into Map Editor there are no columns on either side, I was expecting as I had declared a source and destination table I would see these columns in there.
Obviously I have got my wires crossed. Can anyone point out where I am going wrong please.
Thanks
Hi,
When you set up your DB connection, you should define the related schema and then use a "Main" row to link tMssqlinput and tMap.
Please see the related reference:
Setting up a DB connection.
In addition, I have seen there is a error icon in your tMap(Maybe it is caused by missing schema)we usually open the code tab and see if there has compile error, then, close the job and open it again, the x-mark appears. If the job has compile error, you are always required to fix the error before executing the job.
Best regards
Sabrina
Hi,
Thanks for your feedback. Perhaps sometimes components are failure, you should try a few more. Delete it in designer and drag a new one into it or restart your studio to see if this issue repro again.
Best regards
Sabrina
Hi Sabrina,
Many thank you to you and the others for helping me with this.
Can I ask is it possible to change the default insert in this job?
Looking at the java code at the moment it is something like:
INSERT INTO tblCampainTest
(
,
,
,
,
,
,
,
)
VALUES
(
?,
?,
?,
?,
?,
?,
?,
?
)
However this column id is an identity so it should just be:
INSERT INTO tblCampainTest
(
,
,
,
,
,
,
)
VALUES
(
?,
?,
?,
?,
?,
?,
?
)
I would think I could just go in and edit the generated java code but is there a more preferred way?
If I need to start a new post for this it is not a problem.
Thanks again, Dave.