'Can I export server name as column value into a flat file destination?

I have a parameterized OLE DB Source connection manager in SSIS. From that I want to retrieve just the server name and print it as a row in a flat file destination.

The connection manager is something like

"Data Source=TESTSERVER.local;Initial Catalog=TEST_DB;Provider=SQLNCLI11.1;Integrated Security=SSPI;Auto Translate=False;"

From this I want to retrieve just TESTSERVER.local and use it as a column value. Can anyone please help me here?



Solution 1:[1]

You should have access to that parameter for the whole connection string.

Try using TOKEN twice in a derived column.

TOKEN(TOKEN(Parameter, ";",1), "=",2)

https://docs.microsoft.com/en-us/sql/integration-services/expressions/token-ssis-expression?view=sql-server-ver15

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 KeithL