I'm trying to come up with a C# code on Script Task. My C# is not that great. What I'm trying to achieve looks like this in TSQL:
SELECT*INTO Server2.DatabaseNameXX.Sample.@MyTable
FROM Server1.DatabaseName.dbo.@MyTable
Please note that the Script Task will be inside a Foreach Loop Task and hence table name is a variable.
Can someone please kindly give me a sample C# code to address the above requirement. The sample code should include how I should handle the @MyTable variable as well as connection managers for the two servers.
Many thanks,
Mpumelelo