You are viewing limited content. For full access, please sign in.

Question

Question

SQL Prime Key as Token

asked on June 25, 2021

Is there a way to pull a primkey to set it to a token in Workflow. It currently seems this isn't a built in feature; I have queried a table, but when going through each row to modify a previously created token the column PrimKey that is in the table does not show as available.

 

 

 

Could this be circumvented with a Custom Query along the lines of

SELECT [Instance ID]
     FROM TestTableIT
     WHERE 
       (SELECT DISTINCT PrimKey);

Then have a For Each Row Update Data... the only issue with this would be that the Update Data step still wouldn't be able decipher the disctinct PrimKey due to a lack of a token.

0 0

Answer

SELECTED ANSWER
replied on June 25, 2021

For more context; information needed to be written to a SQL table via two separate Workflows. The first Workflow originally wrote four column values with the identical information. The second workflow was unable to distinguish these rows to then update the remaining three columns, and a Primary Key is unable to be selected as a distinct token. Added a Row Number column, that is then used to identify separate rows.

This is the second workflow:

 

 

Result:

0 0

Replies

replied on June 25, 2021

Assuming you are selecting all columns in Query Data, did you test the query in that activity after modifying the table? The tokens for Query Data are generated based on the columns returned when the query is tested.

0 0
replied on June 25, 2021

Yes, both the regular query and the custom query find what I am looking for and returns all of the colums. But it seems workflow doesn't allow columns that are set as a SQL Primary Key are unavailable to be used as tokens.

 

I will need to add a new column, such as Row Number, that is not a Primary Key for this to work. I will add my work around once it is built for anyone that is looking for a solution to the same question.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.