Home Forums SQL Server 2005 Business Intelligence SSIS - Assign value to a variable - Need ServerName from DestinationConnectionOLEDB as @Enviro from email RE: SSIS - Assign value to a variable - Need ServerName from DestinationConnectionOLEDB as @Enviro from email

  • Barry

    How do you configure the server name for the connection string? Do you use a dtsConfig file, or a SQL table, or is it hard coded? Does the server name change during package execution (in other words, does the package loop through several servers)? Gus's way will certainly work, but if there's a way to use an existing variable then I think that would be better than incurring a connection to the database.

    For your second question, I'd use the OUTPUT clause in your INSERT statement to populate a table variable, the do a SELECT COUNT(*) FROM that variable - that's assuming you're not writing millions of rows at a time into the table?

    John