NOTE: Creating SQL expressions and scripts requires a good knowledge of Transact-SQL.
See relevant resources, for example, https://docs.microsoft.com/en-us/sql/t-sql/language-reference?view=sql-server-2017.
To configure an Execute SQL operation:
Under SQL, enter a SQL expression or script containing Transact-SQL statements. To insert a placeholder for dynamic data, click Insert Placeholder and use the Select Placeholder window to choose a field or macro that will be replaced with the actual value at runtime.
TIP: If you want to see in details a User Macro or a Workflow Parameter referenced by the placeholder, right-click the selected placeholder and choose Placeholder Definition. It opens the Macro window (Workflow Parameter window). If necessary, update details and click OK. The placeholder would be updated with new values.
Keep the Enable operation check box selected to enable the operation. Otherwise, the operation will be disabled.