Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I got stuck how to get the unique sequence number when the same job runs in two different machines at the same time in the same table. The sequence number should be unique and update the rows in the same table without any rows missed.
looking for any suggestions.
Thanks in Advance
You need to set up a sequence in your database. Take a look here for that: https://docs.microsoft.com/en-us/sql/t-sql/statements/create-sequence-transact-sql?view=sql-server-2...
Then you need to use that sequence in Talend. To do that you can use a tMSSqlInput with code similar to below (assuming your sequence is called MySequence).
"SELECT NEXT VALUE FOR MySequence as seqnum"
The only way to do this is to use a database sequence (if you can) or to hold the sequence in another location that both (all) jobs have access to. I generally use a database sequence to handle anything that requires a sequence that isn't reset after the job has finished running.
Thank you for the quick reply
Can u please elaborate how would we implement in TDI for MSsql.
please help.
thanks,
raghav
You need to set up a sequence in your database. Take a look here for that: https://docs.microsoft.com/en-us/sql/t-sql/statements/create-sequence-transact-sql?view=sql-server-2...
Then you need to use that sequence in Talend. To do that you can use a tMSSqlInput with code similar to below (assuming your sequence is called MySequence).
"SELECT NEXT VALUE FOR MySequence as seqnum"