Topic: SSIS - execute SQL task. How to obtain the data from the temporary table?
I need to form "on the fly" the big team SQL for another's server (not SQL).
For this purpose I use Execute SQL Task that this command to splice from slices. An operating procedure:
1) I Fill SQLStatement.
Something like it:
-- Variable for operation declare @my_command nvarchar (max); -- We form team SQL (here there can be a lot of code) set @my_command = ' select from tbl_main where (......) '; set @my_command = replace (@my_command, ' old_val ', ' new_val '); set @my_command = '..... '; -- Here this deduces final command SQL and I want to read it in SSIS a packet select @my_command as col1;
3) On tab General I write that resultset should be SingleRow.
2) On tab ResultSet I show that the variable should read value of a column col1.
does not work. SSIS the packet does not want to read value of a column col1.
I already faced it is because of sampling "on the fly". I.e. here it: select @my_command as col1;
If there there was a real table all would be good. How to win??