select clientid, clientname from mlproduction.dbo.client where clientid in (10979,7187)
when I run the final automation Script with Select to File resulting Excel file contains data Clientid = 10979 but the name of the file (using #variable#) contains 7187.
You are using #client_SQL# in the export file name of the File_1 activity. client_SQL is a SQL-type variable meaning its value is a result set. In case such variable is used ‘as is’ w/o specifying a column, the value of the 1st column in the 1st row is substituted. In your case it’s 10979.
To fix it, use #client_SQL.clientid# in the export file name instead.