0

After executing my mapping dataflow I would like to run a clean-up script using the Post SQL Script option of the Sink activity.

enter image description here

However I'm not having much success with the expression builder. This is what I've tried so far:

concat ( 'UPDATE [cfg].[Entity] SET SchemaVersion =' , toString(CachedEntities#lookup($EntityName).EntityID + 1) )
user1309226
  • 739
  • 1
  • 10
  • 31
  • is SchemaVersion a string column or numeric? – Mark Kromer MSFT Apr 11 '22 at 03:05
  • Custom expression should be an array of strings not string. Wrap your expression in square brackets and see if that fixes the issue. [concat ( 'UPDATE [cfg].[Entity] SET SchemaVersion =' , toString(CachedEntities#lookup($EntityName).EntityID + 1) )] – Ramesh Kanjinghat Apr 12 '22 at 16:59
  • 1
    The error was in the syntax. It works this way: toString(CachedEntities#lookup($EntityName).SchemaVersion + 1) – user1309226 Apr 21 '22 at 20:47

1 Answers1

0

Thank you @user1309226 for updating the error cause and resolution in the comments. Posting it as an answer to help other community members.

This syntax worked: toString(CachedEntities#lookup($EntityName).SchemaVersion + 1)

enter image description here

NiharikaMoola-MT
  • 4,700
  • 1
  • 3
  • 15