Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

For Each Loop SSIS tasks for dynamic SQL

$
0
0

Hi all,

I want to apply some ALTER dynamically to some tables in SQL according values in another SQL table.

I’ve thought do it by using For Each Loop task with a couple of Execute SQL Task.

I don’t know how to use in every iterator all the variables that I need for perform the ALTER

First task.

  SELECT COLUMNNAME,TABLENAME,TYPEENCRYPTION

  FROM [dbo].[DataObfuscationReferences]

In this first task, as per my understanding, Foreach ADO Enumerator as Enumerator and then in Variable Mappings I’ve defined every variable:

Second task.

Once the values have been catched, they wil be used for the next Execute SQL Task.

T-SQL example:

ALTERTABLE dbo.SampleMask2016ALTERCOLUMN Lastname 

ADDMASKEDWITH (FUNCTION='partial(2, "XXXXXXXX", 1)')

Almost everything is dynamic, how can I use them in this task?

ALTERTABLE ??????ALTERCOLUMN ???????? 

ADDMASKEDWITH ???????????????????????????????????

Thanks in advance for your help,



Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>